Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
3answers
79 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 ...
0
votes
1answer
610 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
1answer
279 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
48 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
1answer
48 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
27 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
101 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 ...
0
votes
1answer
211 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 ...
0
votes
1answer
43 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
170 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
199 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
141 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
37 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
42 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
117 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
1answer
256 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 ...
0
votes
0answers
263 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 ...
0
votes
0answers
205 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 ...
2
votes
1answer
182 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
2answers
2k 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. ...
1
vote
4answers
329 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, ...
3
votes
1answer
832 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 ...
0
votes
1answer
77 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 ...
0
votes
1answer
146 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
45 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
275 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
271 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 ...
0
votes
1answer
101 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 ...
1
vote
2answers
676 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 ...
1
vote
0answers
267 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 ...
-1
votes
1answer
61 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
1answer
62 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 ...
0
votes
1answer
357 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): ...
1
vote
2answers
304 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
444 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
1answer
1k 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 ...
1
vote
1answer
289 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
1answer
63 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
3answers
168 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
1answer
107 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
1answer
99 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 ...
-4
votes
1answer
258 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
1answer
130 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
1answer
186 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
2answers
61 views

301 redirect from non www to www issue

I have been trying to set a 301 redirect from a non www to a www domain since yesterday but it only cause problems on my site. I first tried it from the control panel of the website, then by modifying ...
0
votes
1answer
86 views

Accessing Apache virtual host on my local machine

I use dyndsn.org and port forwarding to manage access of my local Apache webserver from the Internet. It access my apache htdocs via http://myusername.dyndns.org/somesite. However, I have set an ...
0
votes
3answers
1k 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
1answer
143 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
1answer
127 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; ...