Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

3
votes
3answers
82 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 ...
3
votes
1answer
229 views

htaccess mod_rewrite conundrum

Ok, so I have this .htaccess file that contains this <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} ...
3
votes
1answer
855 views

Conditional 301 redirect depending on server (localhost vs production)

By practise I do a 301 redirect non-www -> www for my production server deployments. But I have a little annoying problem/discrepency with the .htaccess rewrite settings between my development server ...
3
votes
1answer
318 views

Setting up a complex Apache reverse proxy

We are about to move a website to a new server running a new piece of software, normally a simple change but we also have a dutch version of the website running in a folder /nl. We would like to ...
3
votes
1answer
1k 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> ...
3
votes
2answers
4k views

Apache basic auth for a particular URL

I have a site in production that I want to modify (translate from French to English). The modified part will be placed in the domain.com/en URL location and I want to protect only this part with a ...
3
votes
2answers
6k views

Can't gzip some JS and CSS files

I am optimizing a magento store, and some JS and CSS (compiled and minified in a MEDIA folder) aren't being served gziped as they should. All pages are gziped (ex. this HTML page) but some content ...
3
votes
2answers
1k views

How should I separate public and private pages on my webserver?

What I want to achieve I have public and private sites on my webserver, and I would like to somehow separate them, but I want this separation to be invisible. So for example DocumentRoot is /var/www ...
3
votes
1answer
2k views

Block A City From Visiting my Website [closed]

I understand it is possible to block a country from viewing my website using apache, .htaccess. I was wondering if it is possible to block everyone from a specific City (namely the city of Flower ...
3
votes
2answers
258 views

Is there an Elegant solution to rewrite long image?query-urls into cachable_nice_urls, using only apache htaccess?

this is a pain in the ass-problem! Whicever genius solves this riddle will receive paypal donation to eat diner for two. Now lets get started. Given: most proxies, do not cache resources with a "?" in ...
3
votes
6answers
283 views

htaccess noob needs your opinion and elite skills :)

brand new with .htaccess and I have read the howto's for weeks along with a load of experimenting. I desperately need someone to look at the thing for me and tell me if anything is wrong or just plain ...
3
votes
1answer
2k views

Apache: How to redirect OPTIONS request with .htaccess?

I have Apache 2.2.4 server with a lot of messages like this in the access_log: ::1 - - [15/May/2010:19:55:01 +0200] "OPTIONS * HTTP/1.0" 400 543 ::1 - - [15/May/2010:20:22:17 +0200] "OPTIONS * ...
3
votes
3answers
1k views

Apache redirect to https for basic auth

I have a tricky variation on an old problem. I have an apache based site that should generally be accessed via http/port 80. However for certain areas protected areas that require authentication ...
3
votes
2answers
104 views

determining if .htaccess is working

Following some guide on the web, I have created the following .htaccess for my WordPress installation: # protect the htaccess file <files .htaccess> order allow,deny deny from all ...
3
votes
1answer
10k views

Enable php extension within .htaccess

Does anyone know how to enable a PHP extension within the .htacess file? Possibly: (.htaccess file) php_value extension=php_soap.so
3
votes
3answers
1k views

Need help finding what is wrong with my .htaccess not being read

I'm trying to use mod_rewrite through the .htaccess files and I have a big problem, the .htaccess files don't seems to be read. The machine is running Debian 5.0 and it's using the stable apache2 ...
3
votes
5answers
5k views

Apache Redirect folder to subdomain

A client had an application at www.domain.com/dir. They have now set up a subdomain at dir.domain.com. The subdomain references the files stored at www.domain.com/dir. They'd now like people accessing ...
3
votes
4answers
2k views

apache 2.4, mod_proxy_fcgi not honouring .htaccess, work around needed

I am using apache 2.4.7 with mod_proxy_fcgi for purpose of passing through php to php-fpm (this will be used for shared hosting environment). The htaccess works fine for non php files, but once it hit ...
3
votes
1answer
639 views

htaccess IP blocking with custom 403 Error not working

I'm trying to block everyone but 1 IP address from my site on a server running apache & centos. My setup is follows the example below. My server: `http://www.myserver.com/` My .htaccess file ...
3
votes
1answer
131 views

Apache2 Basic Auth: user@ip, user2@ip2 - Is this possible?

I am looking at running an external service for clients to use here in my office while clients are working remotely at their office. Assumptions: Both my office IP and clients office IP are static. ...
3
votes
1answer
129 views

redirect 301 subdomain to same subdomain but in new folder

i want to redirect 301 subdomain to same subdomain but in new folder See what I mean .. http://sub.site.com/(.*) to http://sub.site.com/folder/ but when i go to folder the page not open Note: the ...
3
votes
1answer
761 views

Redirecting paths to shebang through .htaccess?

I had a small bit of code that would redirect pages accessed from my own domain to their hash addresses, like so: example.com/stationary.html => example.com/#/stationary This was the code: ...
3
votes
1answer
107 views

Part of my URL is being stripped away

I've discovered that one of the sites on our web server is having part certain URLs stripped away. Specifically, when a user clicks the link to display images as a slideshow the URL for that page has ...
3
votes
1answer
750 views

Image caching using HTTP_IF_MODIFIED_SINCE

I found that adding RewriteRule .* - [E=HTTP_IF_MODIFIED_SINCE:%{HTTP:If-Modified-Since}] RewriteRule .* - [E=HTTP_IF_NONE_MATCH:%{HTTP:If-None-Match}] To the bottom of my htaccess file (below all ...
3
votes
1answer
686 views

mod_rewrite !-f and !-d ignored for .php extensions

I have an .htaccess file on an Apache 2 server: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
3
votes
3answers
11k views

Password protect directory with Apache: “couldn't check user. Check your authn provider!”

I am trying to password protect a web directory with apache. I have the site set up like this: D:/ webapp/ lib/ .htpasswd document_root/ admin/ index.php ...
3
votes
2answers
417 views

Host Primary Domain from a subfolder

I am having a problem making a sub directory act as the public_html for my main domain, and getting a solution that works with that domains sub directories too. My hosting allows me to host multiple ...
3
votes
1answer
3k views

allowing index access only with .htaccess

I have this in my .htaccess file, in the site root: Options -Indexes <directory ../.*> Deny from all </directory> <Files .htaccess> order allow,deny deny from all </Files> ...
3
votes
1answer
1k views

How to prevent external direct-link to files with htaccess?

I have this in my htaccess at the public_html folder of my file server: RewriteEngine On RewriteBase / ReWriteCond %{REQUEST_URI} ^/files/* RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ...
3
votes
1answer
354 views

htaccess rewriting all subdomains to subdirectories

I'm trying to build a catch-all for any subdomains (not captured by previous rewrite rules) for a certain domain, and serve a website from a subdirectory that resides in the same folder as the ...
3
votes
1answer
955 views

How to exclude IP from htaccess domain redirect [duplicate]

I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is: RewriteEngine on RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ ...
3
votes
1answer
211 views

Trouble with www. redirect (.htaccess)

I'm trying to get a simple www. to non www. redirect set up. Here's the .htaccess DirectoryIndex index.php RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.org [NC] RewriteRule ^(.*)$ ...
3
votes
2answers
1k views

URL Rewriting Problem [duplicate]

I'm trying to rewrite my URL's subdomain. http://username.domain.com will show content of http://www.domain.com/user.php?u=username but URL stay as http://username.domain.com . (I mean url masking) ...
3
votes
2answers
50 views

Redirect directory content

I have the following directories on my Apache server: root/dir1/ root/dir2/ root/dir3/... Is it possible to make the contents of my sub-directories (dir1, dir2, dir3) "as if" it was directly in ...
3
votes
2answers
1k views

.htaccess per directory in nginx

I am new to nginx and I have been on apache before. In apache, each directory can have a .htaccess to target the directory and and it's subdirectories. Is this possible for nginx? If so, how do I do ...
3
votes
4answers
449 views

Internal server 500 error

Hello Everyone I have created the following script in my .htaccess file Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} domain.eu RewriteCond %{REQUEST_URI} !^domain RewriteRule ...
3
votes
1answer
2k views

Subdomain doesn't work without www in front of it

I had a subdomain setup in cpanel before (sub.domain.com to redirect to domain.com/sub/) and suddenly today I noticed that it was rewriting the URL in the browser to www.domain.com/sub/ instead of ...
2
votes
2answers
146 views

cant upload .htpasswd

G'Day Faulty Friends, I just tried to upload .htaccess & .htpasswd to a clients server over FTP, and although the FTP process seems to go smoothly, refreshing the view shows that neither file are ...
2
votes
4answers
6k views

.htaccess does not ask the password

I am using Ubuntu 12.04 and trying to use .htaccess on a page with apache2 server on it. My .htaccess file looks like this: AuthType Basic AuthName "Password Required" AuthBasicProvider file ...
2
votes
5answers
2k views

.htaccess being hacked repeatedly [duplicate]

About 4 or 5 days ago, a client came back to me saying that their site was being redirected to some other suspicious looking website from Google, Yahoo, etc., but it was working fine when the user ...
2
votes
2answers
206 views

.htaccess redirect visitor if he has a cookie is from accounts.google.com [closed]

I am creating a gateway page that redirects visitors based on what services they are using. How should a .htaccess rule that redirects a visitor if he has a cookie originating from the domain ...
2
votes
3answers
3k views

How do you do wildcard subdomains?

I want subdomain.example.com to point to example.com/profile.php?user=subdomain With "subdomain" varying with user input How do you do that? Also, I want it to be a silent redirect, so the ...
2
votes
1answer
762 views

Nginx rewite rules 403 error

I am having trouble with converting .htaccess files to nginx. I have 3 .htaccess files. The first .htaccess file is located in the document root and is as follows: Options +FollowSymLinks ...
2
votes
6answers
338 views

Using mod_rewrite to shutdown website

I am trying to shutdown a website to everyone except my ip address. I almost have it working. I cannot access www.mysite.com, but I can access all folders that have another .htaccess file in them. I ...
2
votes
5answers
2k views

500 Internal Server Error when adding a line in the .htaccess file

I need to add the following line into my .htaccess file in order to get my website working with mod_security SecFilterScanPOST Off but then I get an error Internal Server Error The server ...
2
votes
8answers
11k views

Excluding a directory from a root .htaccess rewrite rule to allow it to be password protected?

I have spent a tremendous amount of time the last week trying to figure this out, but no matter what I try I cannot get this to work. My web host said they did not have anyone who knew enough about ...
2
votes
4answers
192 views

Using .htaccess to hide files

Let's say I have an index.php file inside my public directory. Using DirectoryIndex index.php, I can set that file as my default index in my website. But what if I don't want users to enter through ...
2
votes
1answer
74 views

Should one put the Apache configuration into apache conf or .htaccess?

I've been wondering what is more efficient to use either configuring for instance the mod_rewrite rules on the conf file for the virtual host (loads once and that is it), or put it in the .htaccess ...
2
votes
2answers
195 views

Understanding .htaccess

I need to understand how .htaccess works. Can you give me some pointer, tutorials about how .htaccess works? Also, the scripting language from htaccess file is 'interesting'. What is it about?
2
votes
3answers
6k views

.htaccess requires password in chrome but not other browsers?

We have .htaccess on our site http://subdomain.site.com/: AuthType Kerberos AuthName "Internet ID" require valid-user order deny,allow deny from all allow from all On a sub directory of the ...