Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

3
votes
1answer
94 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
538 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
3answers
9k 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
397 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
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
216 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
640 views

How to exclude IP from htaccess domain redirect

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
188 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
1answer
1k views

Apache sends plain-text response when accessing SSL-enabled site without HTTPS

I've never encountered something such as this before. I was attempting to simply redirect the page to the HTTPS version if it determined that HTTPS was off, but instead it's displaying an HTML page ...
3
votes
2answers
1k views

URL Rewriting Problem

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
1answer
2k views

Error headers: ap_headers_output_filter() after putting cache header in htaccess file

Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file: # 6 DAYS <FilesMatch ...
3
votes
4answers
354 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
1k views

How do I prevent my swf files being hotlinked, downloaded etc

I have swf files that are embedded in a PHP page using SWFObject. These swf files are in the same directory as my PHP files. for example www.myurl.com/index.php embeds www.myurl.com/flashfile.swf, ...
2
votes
2answers
145 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
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
1k views

Is there a limit for .htaccess?

Hey all. I was just wondering if there's a limit for the .htaccess file for Apache 2. I'm working on a caching plugin and thaught that it might be a good idea to use the .htaccess file to point to ...
2
votes
3answers
2k 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
6answers
302 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
1answer
4k views

Apache .htaccess <ifModule not allowed here

Running Apache on Ubuntu Precise, with PHP 5.5 Trying to access my var/www/ gives me a 500. /var/log/apache2/error.log shows: /var/www/web/.htaccess: <IfModule not allowed here my .htacess is ...
2
votes
2answers
723 views

How to dynamically reload nginx config

I'm currently trying to setup Nginx for a domain with production, testing and development stages. Each comes with it's own partial Nginx config file with rewrites. The production and testing stages ...
2
votes
7answers
7k 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
2answers
4k views

What is nginx equalant for my htaccess mod_rewrite?

Previously i was using linode VPS running Apache for my CodeIgniter website. Today i installed nginx and my website landing page is coming but the other pages that is using htaccess for rewriting URL ...
2
votes
4answers
175 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
11k views

How do you redirect URLs with a query string to another host?

This htaccess snippet is supposed to redirect myhost.com/?p=1&preview=true to alt.myhost.com/?p=1&preview=true RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^myhost.com$ [NC] ...
2
votes
2answers
2k views

Only allow GET request with htaccess?

How should I allow only GET request to access all the files and script from my server using htaccess? My web server is Apache
2
votes
2answers
185 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
4k 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 ...
2
votes
2answers
583 views

Can't figure out how to enable mod_rewrite on ubuntu

I feel like I've done everything right: josiah@BOX-OF-DOOOM:~$ sudo apache2ctl start apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ...
2
votes
1answer
2k views

HTTPS for /wp-admin/ and HTTP for everything else?

I'm running a WordPress site on a shared Apache server on Dreamhost. I already have define('FORCE_SSL_ADMIN', true); set (and working) in my wp-config.php so that SSL is used for the /wp-admin/ ...
2
votes
3answers
541 views

htaccess vrs httpd.conf?

Is it still true that you shouldn't use htaccess files if you can use httpd.conf? The Apache site says "In general, you should never use .htaccess files unless you don't have access to the main ...
2
votes
2answers
4k views

One RewriteCond for multiple RewriteRules

I need to preserve all user query strings. RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^$ index.html?page=home&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^about$ ...
2
votes
2answers
476 views

Setting SSL redirect ONLY for the frontpage on Drupal?

I want users that visit my site to be redirected to the SSL version when they access it like this www.mysite.com But when they access other urls, such as... www.mysite.com/some ...
2
votes
1answer
328 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 ...
2
votes
2answers
4k views

.htaccess deny from all does not work?

I am running Apache 2.2.20 on a Ubuntu 11.04 web server. I have a Joomla site running on it, but I have also added some custom content. In the main web directly I have added a folder ...
2
votes
1answer
227 views

htaccess email regex

I am trying to write a patter in such a way that this link : http://www.mysite.com/link/go/emailadress@gmail.com is interpreted like this : ...
2
votes
1answer
1k views

.htaccess - redirect non www to www and retain subdomains from redirecting

So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'. ...
2
votes
1answer
169 views

Lighter alternative to Apache supporting .htaccess

Is there a lighter alternative (runs in shell, in one process, can be started and stopped easily by the user) to Apache that supports .htaccess files? If not, how could Apache be run in a "lighter" ...
2
votes
1answer
641 views

Proxy all requests for subdomain to an ip via htaccess/apache

Let's say I have the following subdomain with its own document root etc: monad2.mysite.com I want that all requests are proxied to an IP (for instance 193.159.3.129) but they must pass through the ...
2
votes
1answer
961 views

Hide cPanel login page?

I use the url http://example.org/cpanel to log in. This is accessible to anyone which seems like a bad idea as anyone can guess it's there. How can I hide it and make it accessible via .htaccess ...
2
votes
4answers
204 views

Rename url hiding file extension

I want to show the URL http://some.com/designit/portfolio.php?cat=website&subcat=nature as http://some.com/designit/portfolio/website/nature. cat and subcat in the URLs may be present, but not ...
2
votes
1answer
150 views

Restrict audio file access by domain on S3 and/or Apache

We has some proprietary audio files we are streaming via html5. These files sit in an Amazon S3 bucket. The audio files have special high and low pass filters and other scientific alterations and ...
2
votes
1answer
391 views

.htaccess Allow owner of home directory only?

Suppose I have a home directory "~someuser/www" which Apache (maintained by someone else than me) exposes as http://www.myserver.com/~someuser . If I want to limit this directory to certain users, I ...
2
votes
2answers
72 views

Make www.domain.com/admin points to a different directory other than /admin

The code is organized in the following directory structure: /frontend/ index.php ... /backend/ index.php ... Note that /frontend and /backend are at the same level. I have setup a ...
2
votes
3answers
2k views

How to throw a 404 error from htaccess?

Everything I find seems to be about created a custom 404 page. That is not what I am trying to do. If I want to block access to a page I can do this in htaccess: RewriteRule pattern - [F] ...
2
votes
3answers
852 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 ...
2
votes
1answer
174 views

Redirect subdomain.xyz.com to subdomain.abc.com

Hey all, I'm trying to move to another domain, but have many subdomains under the existing domain. All the subdomains will be the same but just mapped with the new domain. [subdomain].xyz.com => ...