Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

5
votes
1answer
1k views

Apache 2.4 with PHP-FPM .htaccess redirection

I have Apache 2.4 set up with PHP-FPM on a server. To pass from Apache to PHP-FPM I use the following: ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9001/hosting_files/site.com/admin_secure/$1 ...
0
votes
1answer
64 views

Apache files directive for single file

I'm trying to restrict access to the wp-login.php file of a wordpress installation to a single IP address using the following .htaccess directive: <Files wp-login.php> order deny,allow ...
0
votes
0answers
41 views

Custom rewrite rule - migationg to WordPress CMS

I am trying to move my image gallery site from one CMS to Wordpress. On current CMS I have page with medium size image on it with URL: ...
0
votes
1answer
80 views

htaccess: Only allow file access via the complete path, not the rewritten one

In my setup i have my CMS reside in a subfolder /sub and i rewrite all the access to the root to this subfolder: ## Rewrite www.example.com to the CMS home page: www.example.com/corporate/index.php ...
0
votes
0answers
74 views

GZIP compression for merged and specific files

My Website is using a CMS (Typo3) that has the feature to merge and compress all JavaScript and CSS Files. With htaccess i also enable the server side gzip feature which will work fine. But it seems ...
3
votes
3answers
71 views

Does high traffic on HTACCESS affect the server?

i have a website and a sub domain.. the main website is hosted in server A and its sub domain in server B.. main website = server A sub domain = server B when i have high traffic i will ...
0
votes
1answer
146 views

Converting Drupal Boost .htaccess to Nginx

I'm trying to install Boost module to work with nginx. As we know Boost does not generate nginx directives just like Apache. Boost has the following directives for Apache's .htaccess: ### BOOST ...
0
votes
1answer
511 views

use .htaccess to change the url example.com/mobile to m.example.com

I have am setting up a social network script, it has both a desktop and a mobile version of the site. When a mobile device tries to browse the site, the mobile page is served with the url ...
0
votes
2answers
90 views

getting started with apache mod_rewrite on a virtual host [duplicate]

hey SO I am attempting to use apache's mod_rewrite module to do some basic rewrting of url on my website so they become a little more seo friendly basically I have a virtual host file that look ...
-4
votes
1answer
186 views

How to change .htaccess file to work right in localhost? [closed]

I have this snippet code in my .htaccess file to prevent users from hotlinking the server's images: RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} ...
0
votes
3answers
69 views

Apache URL resolution - serve html file as directory

I've changed my web hosting provider and now I have a configuration problem: In the root of my site, I have a file called beta.html. The Apache configuration on previous webhost would serve its ...
1
vote
1answer
47 views

RewriteRule preserving path across environments [duplicate]

I'm trying to come up with some redirect rules that'll work on my local working directory and production. The problem being my local dev env works via "localhost/exp" where as the production works ...
1
vote
2answers
243 views

Virtual Host Configuration and mod_rewrite - Removing PHP Extension and Adding Forward Slash

On my production server, things are fine: PHP extension removal and trailing slash rules are in place in my .htaccess file. But locally, this isn't working (well, partially, anyway). I'm running ...
0
votes
1answer
195 views

Permanently Redirect Subfolder Blog to Subdomain on Another Server

Seems this server redirect question may be better suited for serverfault than wordpress stack exchange. Originally we had a static marketing site at example.com and the wordpress blog hosted at ...
1
vote
1answer
41 views

How to change the document roots of multiple parked domain names?

I was able to change the document root of one of my parked domain name using the method described here: Change the document root of a parked domain? by rutiolma. Although, when I tried adding another ...
0
votes
1answer
23 views

Redirect issue: folders and files not redirected properly

I have recently set a new URL http://www.mytechnotes.biz for a blog I was maintaining on a subdomain http://technotes.tostaky.biz. The redirection works in the following cases: ...
0
votes
1answer
92 views

“Allow from” remote hostname works but not when using SetEnvIf in .htaccess

In .htaccess, I am trying to restrict access by remote hostname, e.g. requests coming from googlebot.com. I have found the following works: Order Deny,Allow Deny from All Allow from googlebot.com ...
1
vote
0answers
77 views

Request exceeded the limit of 100 internal redirects due to probable configuration error

This error only seems to happen to a few pages. Others will load just fine, some slower, but others will error out: # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
0
votes
1answer
919 views

Debian - www directory owned by root and not apache2?

So I have a couple of problems on my server. WordPress is unable to modify .htaccess, and the same files (exact same files) are running fine on another server. Me and my friend also tried setting ...
3
votes
1answer
12k views

How should I use the <If> directive in .htaccess?

I'm trying to add a conditional statement using Apache's If directive in my .htaccess file. I have referenced this page http://httpd.apache.org/docs/trunk/mod/core.html#if but it doesn't elaborate ...
0
votes
1answer
117 views

Trouble converting .htaccess rewrite rules for nginx

Hi all I am trying to convert the following .htaccess code <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
3
votes
3answers
930 views

Set MIME type of PHP generated JavaScript file

I have a dynamically created .js file by PHP. For this to work I added the following to an Apache .htaccess file: AddHandler application/x-httpd-php .js AddType application/javascript .js But the ...
0
votes
1answer
40 views

.htaccess rule to change hosts for SEO

I want to migrate one of my client's website from a free host to paid host. Currently, the site/domain is being hosted inside a sub-folder (used this tut: https://my.bluehost.com/cgi/help/347) at the ...
0
votes
0answers
151 views

htaccess redirect affects bingbot, returning Redirection limit reached

Inside my .htaccess file, I have the following script: RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] <IfModule mod_rewrite.c> ...
1
vote
1answer
144 views

Apache: ExpiresByType per directory?

I have a folder with javascript files that should expire faster than the normal scripts. Is it possible to let files expire per directory using Apache 2 other than .htaccess? <IfModule ...
1
vote
0answers
128 views

Limit file access/download by count in Apache

I'd like to limit the number of times a file/image can downloaded/viewed to an upper count. For example if I have an image called /Limited.jpg and I wish that it can be downloaded/viewed only 1500 ...
0
votes
0answers
34 views

htaccess works fine on local but differently on remote

Hi I have an htaccess working fine on my local machine but when i upload it to my remote machine it works differently. RewriteEngine on RewriteCond %{REQUEST_URI} ...
0
votes
1answer
230 views

Apache Tomcat directory access, restricted and accessible only by web application

I have a Grails app. I want to move out all the images users upload to a directory outside of my web-app directory, somewhere else on the disk. Then I want to allow my application to serve them on ...
3
votes
2answers
7k views

Convert and redirect URL in uppercase to lowercase using .htaccess

I would like redirect a URL with uppercase characters http://localhost/A/B to a lowercase version http://localhost/a/b using the .htaccess file. Using regex I can capture A and B but is it possible ...
0
votes
1answer
36 views

Rewrite a directory to another directory without a redirect [duplicate]

I have the following rewrite rule: RewriteRule ^support/(.*)$ /blog/support/$1 [R=301,NC,L] However, all it does is a simple redirect. What I want to is for /support to show the contents of ...
0
votes
0answers
96 views

Enable gzip for source maps

I'm using the Grunt plugins to concat, minify and generate source maps of my Javascript before I push it to the production server (I'll soon be doing the same with SASS for CSS). The source maps ...
0
votes
0answers
255 views

How to convert this .htaccess to Lighttpd?

I converted .htaccess below to Lighttpd but it doesn't work. What mistake did I make? You can find original .htaccess below, and the file I converted below it. Original .htaccess: RewriteEngine On ...
2
votes
1answer
140 views

I'm getting 500s while LIMIT / block http POST request w/ Apache(

I'm trying to use core - Apache HTTP Server's <LIMIT> Directive to limit spamers from doing POST's to my website(s): <Limit POST> Order deny,allow Include ...
0
votes
0answers
168 views

redmine in subfolder issue (Apache, mod_passenger, Ruby + Drupal site in main folder)

I have Redmine in subfolder /var/www/redmine and Drupal in folder /var/www/ When I go to URL mysite.com/redmine, Redmine shows ok, but mysite.com/redmine/login is (over)handled by Drupal. Apache ...
1
vote
4answers
212 views

HTTPS / HTTP mod_rewrite rules, strange interaction with subsequent CMS index.php rewrite

With the below rewrites in htaccess, as expected, this HTTPS request is not rewritten: https://example.com/system/anything is not re-written to http://example.com/system/anything But, ...
-1
votes
2answers
1k 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
1answer
86 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 ...
2
votes
1answer
552 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
1answer
288 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
1answer
70 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 ...
5
votes
4answers
2k 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
1answer
81 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 ...
1
vote
1answer
42 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). ...
2
votes
1answer
210 views

Force HTTPS w/ Load Balancer and without (.htaccess rewrite)

I have the following code as a rewrite rule. RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] This ...
1
vote
2answers
219 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
1answer
34 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 ...
1
vote
2answers
516 views

Amazon EC2 .htaccess and 500 Error

I have an Amazon EC2 (amzn-ami-pv-2013.09.0.x86_64-ebs (ami-149f7863)) on which I installed Apache, PHP and MySQL. All works fine until I try to activate .htaccess. I change AllOverride All in ...
0
votes
2answers
969 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
1answer
55 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 / ...
1
vote
0answers
220 views

How to rewrite using htaccess if the file exists in another folder?

We are trying to rewrite to another folder if the file does not exist in the document root, but does exist in the other folder. The other folder is in a completely different location, which is ...