Questions tagged [.htaccess]

Directory-level configuration file found mostly on Apache web servers

Filter by
Sorted by
Tagged with
11 votes
2 answers
45k views

Apache .htaccess error: 'not allowed here' on Debian Wheezy

I am trying to configure an apache virtualhost which needs to be password protected in the root directory. So I created a .htpasswd file (with sha passwords) and configured the .htaccess file. ...
0 votes
1 answer
743 views

Rewrite not working in htaccess (apache2.2.22, windows server 2012)

I'm sure that my .htaccess file is being read by Apache as I tried to write in random stuff in it, eg: "sifnoweijf", and my page could no longer be displayed. but why the following rewrite doesn't ...
3 votes
1 answer
3k views

.htaccess not working on Cent Os 6.4

I have installed Cent Os 6.4 -Final Version and set the environment for PHP web development. My application uses the .htaccess for url rewrite & denying direct access of files. my configuration ...
1 vote
1 answer
466 views

Failed PCI compliance - 403 (Forbidden)

Due to a recent upgrade in the scanning done by our PCI compliance testers, we recently failed a PCI, and the suggested solution is as follows: Configure the HTTP server to specify the same error ...
0 votes
1 answer
180 views

Order that Apache handles .htaccess directives

I was working on a WordPress site yesterday, mostly in a Web Performance Optimization capacity (on shared hosting). At one point I noticed that my .htaccess file had redundant, possibly ...
10 votes
4 answers
21k views

Why do .htaccess redirects work in http but not with https?

I have a simple .htaccess file that works great on the http version of the site but not when I go to https. Why? RewriteEngine on #This is so if the file exists then use the file RewriteCond %{...
0 votes
1 answer
13k views

Redirect specific IP using htaccess [duplicate]

I am trying to figure out if it is possible to do a 301 redirect for a particular IP address (in this case brute force password bot). I want to send this guy to a project honeypot link rather than ...
2 votes
1 answer
786 views

Apache server password file (htpasswd) encoding

I use .htaccess, basic authentication and a corresponding password file to secure my web-space. The hosting is Linux / Apache. I want to support a user name with French accents (ie. not ASCII). Are ...
1 vote
2 answers
1k views

Apache2 mod_rewrite failing for non-existent sub directories [duplicate]

An even shorter version of my .htaccess file (Last RewriteCond wasn't there) use to work perfectly on my shared web hosting but I've moved to a VPS with Ubuntu 12 with it's stock Apache2 but it simply ...
0 votes
1 answer
66 views

Authentication just for HTTPS Requests in Apache

I configure the authentication for my webspace via a .htaccess file (I have no control over the httpd.conf file). For a secure implementation I have an automatic redirection of HTTP to HTTPS via ...
0 votes
2 answers
2k views

How to add iptables ip blocklists to Plesk 10.4.4 (CentOS)?

I'm trying to figure out the best way to add IP blocklists to my Plesk 10.4.4 server (CentOS). It's a simple Virtual Server I recently acquired through my hosting company. I've used .htaccess files ...
-1 votes
1 answer
106 views

How do I redirect al url request using htaccess when I already have rewrite rules?

I've tried everything but simply can't get this to work. This is the default Wordpress redirect code that sits in my htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
0 votes
1 answer
124 views

Need Corrected htaccess File

I'm attempting to use a wordpress plugin called WP Fast Cache which creates static html files from all your posts, pages and categories. It creates the following directory structure inside wp-content:...
0 votes
1 answer
2k views

serving static file from cookieless domain: alternative cookieless directory

I'm trying to follow all the guidelines of "Google Page Speed​​". The directive "Minimize request overhead" requires static content (images, js, css, etc.) on a static server (ie cookieless): https://...
1 vote
1 answer
4k views

Denying access to website via htaccess based on http header

I've been trying for ages to get this to work and I can't put my finger on it. What I'm trying to do is block access to a site from a number of countries, based on the CF-IPCountry header added by ...
0 votes
3 answers
8k views

htaccess filesMatch exclusion

I have the following directive in my htaccess <filesMatch "\.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml|html?)$"> FileETag None <ifModule mod_headers.c> Header unset ...
0 votes
1 answer
13k views

Compress with Gzip or Deflate my CSS & JS files [closed]

i ve a fashion website & using wordpress. I want to Compress or Gzip or Deflate my CSS & JS files. i have tried many codes with .htaccess to compress but not working. Would any body help me ...
2 votes
1 answer
2k views

htaccess: how to rewrite to clean urls and redirect old urls to the new clean ones? [duplicate]

With htaccess I'm trying to make my sites urls clean. I use very basic urls like: www.mysite.com/pagename.php ("pagename" is variable). I want www.mysite.com/pagename to display the content of /...
1 vote
1 answer
2k views

Cache Busting and Include Files for Nginx

In Apache you can use the following to cache bust css and js files and server them as a single file with Apache's Include mod: <FilesMatch "\.combined\.js$"> Options +Includes ...
0 votes
1 answer
386 views

.htaccess rewrite rule to ignore a directory

I am running a Symphony installation out of the directory symphony but I want to remove that word from the URL in specific cases. When a user visits http://domain.com/demo It should go to http://...
0 votes
1 answer
243 views

.htaccess - permissions forbidden

I have an error with a new virtual host that I can't figure out.. My .htaccess doesn't have web access (403). [Thu Oct 31 17:51:01 2013] [crit] [client ] (13)Permission denied: /srv/data_disk/www ...
0 votes
3 answers
498 views

How do I redirect my website from non-www to WWW using Apache2? [closed]

I'm currently trying to set up my personal webpage. I am using a VPS and have manually installed Wordpress, and everything seems to work... except if I go to the non-www version of my website, it ...
5 votes
1 answer
188 views

How to minimise effect of mischievous, persistent POST requests

For a few months now one of our shared hosting servers has been persistently and constantly hammered by "POST /" requests from what must be hundreds of thousands of individual IPs. On a number of ...
0 votes
1 answer
644 views

.htaccess redirect root directory and subpages with parameters

I am having difficulty trying to redirect a root directory while at the same time redirect pages in a sub directory to a different URL. For example: http://test.example.com/olddir/sub/page.php?v=one ...
1 vote
1 answer
859 views

Add separate domain name to Wordpress admin area with htaccess

I have a Wordpress installation in a seperate folder on my server (meaning it is not in the root folder). Let's call that folder "folder A". I have a htaccess rewrite rule that maps Domain A to folder ...
0 votes
1 answer
2k views

Apache .htaccess rewrite php to js and execute js file as php script

I have the folowing rewrite rule in my .htaccess file RewriteRule ^js_([A-Za-z0-9\.\_\-]{1,50})\.php$ libjs/misc/$1.js so js_messages.php url links to libjs/misc/messages.js file It's working ...
0 votes
1 answer
612 views

htaccess rewrite condition old site to new site with querystring

I am not even going to pretend to fully understand how htaccess rewrite conditions work. I've been working on this for a while searching and searching. I have an old Wordpress site www.old-site.com ...
1 vote
1 answer
1k views

.htaccess - Simulating virtual host wrong link to Parent Directory in Directory Listing

I have a domain dedicated for my local server (.dev), and an .htaccess file which redirects requests like http://folder.dev/subfolder/ to /htdocs/folder/subfolder. It works great and all, except for ...
4 votes
1 answer
7k views

How multiple <Directory> sections work in Apache configuration (httpd.conf)?

For example, if my '/etc/apache2/httpd.conf' looks like this: <Directory /> AllowOverride None </Directory> <Directory /home> AllowOverride FileInfo </Directory> The ...
0 votes
1 answer
296 views

Nginx complete folder protection not working

I have installed nginx(1.4.3) with PHP-FPM(5.4.20). i want to protect my wordpress wp-admin folder. my nginx configuration file domain.conf: server { listen 80; server_name example.com; ...
1 vote
2 answers
3k views

Blocking bad bots

I found this script and was wondering if this is just overkill and even worth using? Is it better for me to just use mod_security? # Generated using http://solidshellsecurity.com services # Begin ...
0 votes
1 answer
478 views

htaccess parameter to subdomain

I would like to redirect this http://www.domain.com/test.php?sub=subdomain&type=cars redirects to http://subdomain.domain.com/cars I already have mod_rewrite rules to do the opposite: ...
1 vote
1 answer
3k views

Nginx 404 error page php with params

In Opencart, 404 error is shown in this url: /index.php?route=error/not_found This page has a 404 custom page with the template of all the website. I´ve tried in Nginx with: error_page 404 = /index....
1 vote
1 answer
3k views

Internet explorer cannot display the page, other browsers can, possibly htaccess / server error

After the migration of a high traffic site, from Redhat to Suse, Internet Explorer users (of at least IE 9) have, in some cases, troubles to view the frontpage (error message: "Internet explorer ...
1 vote
1 answer
602 views

Apache Hotlink Prevention not Working

I have been trying to prevent hotlinking of images on a domain of mine without any success. I have added the following to /etc/apache2/httpd.conf RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ ...
3 votes
2 answers
9k views

Request exceeded the limit of 10 internal redirects

so here is the error [Mon Sep 30 00:09:53 2013] [error] [client 66.249.66.205] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' ...
0 votes
1 answer
2k views

How to hide my website port number on website url [closed]

My website has implemented by using JAVA. So we have taken VPS and installed Tomcat then deployed My website is appearing like this whenever I click www.mysite.com in url ... it is appearing as below....
0 votes
1 answer
865 views

Trouble configuring virtual host to allow standard wordpress mod_rewrite for permalinks

I'm having a little trouble getting the standard mod_rewrite that wordpress generates in my directorys .htaccess file to work correctly. The server I'm using has a virtual host set up on it by ...
1 vote
1 answer
44 views

Rewrite Rule for modifying URL structure

I am trying to create a mod rewrite rule to correctly change an existing url structure that looks like this: Old: somesite.com/scripts/data/database.cgi?ArticleID=29154&report=SingleArticle&...
1 vote
1 answer
1k views

.htaccess rewrite not working on port other than 80

I have a simple .htaccess that redirect everything that's not a file or directory to index.php RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f ...
1 vote
1 answer
425 views

htaccess RewriteRule force end of execution Apache 2.2

Hi I have written some rewrites, but from what I can tell from the logs it seems that the rules keep executing and so, although the correct result is achieved mid-execution, the final rewrite is ...
0 votes
1 answer
640 views

New rule to .htaccess file don't work on live site

I had to add a rule to the .htaccess file of existing site, which redirect some old images urls to the new ones. So, directly after the RewriteEngine On I added my new rule: RewriteRule ^images/...
1 vote
2 answers
7k views

nginx and owncloud, .htaccess security warning

I have a problem with nginx and owncloud. When i access the owncloud's login page i get this error: Your data directory and your files are probably accessible from the internet. The .htaccess ...
-1 votes
1 answer
2k views

http:// to https:// Redirection with page reload in Apache 2 (HD Web Hosting) [duplicate]

I'm trying to check to see if the address accessed is using a secure connection when accessing a certain page, or not. If not, I want to redirect the traffic to the proper https:// address. I have ...
1 vote
1 answer
4k views

RewriteBase rule works in .htacess, but not in httpd.conf (inside <Directory ...>)?

Let me explain by example... File: /var/www/example.com/public/wp-content/cache/minify/.htaccess <IfModule mod_rewrite.c> # THIS WORKS... RewriteBase /wp-content/cache/minify/ ...
0 votes
1 answer
118 views

htaccess rules unexpectedly forcing download of gzipped index.html [duplicate]

I'm trying to set up SSL on a Wordpress site. The SSL certificate does not cover both www. and non-www. versions of the URL, so I'm trying to simply redirect everything to https://domain.tld with ...
0 votes
1 answer
27 views

Issue with mod rewites in htaccess on Apache

I am using a private host, linux php, where the htaccess just does not act like it does with the bigger famous top 10 hosts etc. redirect 301 /pagea.html /pageb.html Causes a 500 internal error on ...
-2 votes
2 answers
2k views

Mod Rewrite code with out changing the url in address bar

I When I call http://www.mysite.in/abc/xyz it shoud show up http://www.mysite.in/abc/xyz/index.php but the url shout not change in address bar and it should work with out "/" in the address. Please ...
-1 votes
2 answers
102 views

Website link with out "/" [duplicate]

My Apache 2.2 is running on port "8080" I want to call my site url http://www.example.in:8080/abc/xyz.html/index.php (xyz.html is a folder) as .... http://www.example.in:8080/abc/xyz.html Can ...
-1 votes
1 answer
487 views

redirect / to /?C=N;O=A [duplicate]

I want to be able to use IndexOrderDefault Descending Date for all of my sub-folders, but I want to the first page to be sorted by name (A-Z) I read https://stackoverflow.com/questions/13199268/...

1
32 33
34
35 36
57