Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
2answers
8k 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
751 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
545 views

Apache, htaccess, url rewrite

I have .htaccess file I'm using for testing, here is my file: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] I'm ...
2
votes
1answer
3k 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
2answers
532 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
3k views

Apache server-status returning 404, then redirecting to my Wordpress install

I'm trying to get Munin's various Apachie plugins to work on my web server, but I'm hitting issues. Upon asking Munin to check available plugins, two of the three Apache plugins return an error saying ...
2
votes
2answers
5k 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
380 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
187 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
834 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
1k views

Hide cPanel login page? [closed]

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
225 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
836 views

Apache htaccess passwd - ignoring correct login

I want to password protect a directory. I'm running Apache 2 with cPanel on Centos. For the sake of this post, the directory is /home/user/my-secret-dir I used cPanel's "Password Protect ...
2
votes
1answer
179 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
525 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
74 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
1answer
202 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 => ...
2
votes
1answer
3k views

Problems redirecting Error 400 Bad Request to custom page

I've edited my .htaccess file to the following : ErrorDocument 404 /index.php?page=page-not-found ErrorDocument 400 /index.php?page=bad-request Now the error 404 redirects correctly, yet if i enter ...
2
votes
1answer
2k views

How do you redirect pages from a subdirectory up one level to the root directory

I have recently moved all the content on my website from being in the www.mysite.com/shop directory to being in the root directory. This means that now I need to redirect any request to visit a page ...
2
votes
1answer
517 views

How to set htpasswd for all except LAN?

How can I set htpasswd prompt for everyone who want to access some server except people from LAN (192.168.0.*) ? Thanks for the answers !
2
votes
1answer
1k views

htaccess redirect of 404 error just prints filename, doesn't execute file

On an Apache host, I have a folder called /thumbs with a program in it called program.php that I will use to create thumbnails. There is a .htaccess file that contains the following lines: options ...
2
votes
1answer
8k views

How to exclude one subfolder from my RewriteRule Htaccess rules?

I have a .htaccess in my root of website that looks like this: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain\.pl [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?([a-z0-9_-]+)\.mydomain\.pl [NC] ...
2
votes
4answers
652 views

Lock down Wiki access to password only but remain open to a subnet via .htaccess

Basically we have a Wiki that has some sensitive information stored in it - not the best I know but my predecessor set it up. I want to be able to request password access from any one who is not on ...
2
votes
1answer
171 views

How to make htaccess not redirect to http on form submission

Part of my .htaccess file forces https on certain pages (e.g. when user logs in, enters credit card information, etc.) while forcing http on all other pages. This seems to be the ideal setup for what ...
2
votes
1answer
779 views

htaccess order Deny,Allow rule

I'd like to dynamically add IPs to a block list via htaccess. I was hoping someone could tell me if the following will work in my case (I'm unsure how to test via localhost). My .htaccess file will ...
2
votes
2answers
1k views

Block bots by their Java referrer or User-Agent string?

I have been getting a lot of web hits in my logs that crawl most top level pages of my site and show a referrer as a Java version. I see different variants of the Java versions in the referrer, i.e. ...
2
votes
2answers
1k views

Setting permissions for mp4 and png files in .htaccess

First, I'm brand new to Apache .htaccess. I've got a server that must allow users to dive only into mp4 and png files. So, I've been reading Apache HTTP Server documentation and, according to what it ...
2
votes
2answers
84 views

apache2 points non-www to root instead of website folder

I have few different vhost created and every one has its own folder in /var/www/ like this /var/www/example1/ /var/www/example2/ Now, when I type url with www www.example1.com it points to the ...
2
votes
3answers
237 views

Block Offline Browsers

Is there a way to block offline browsers (like Teleport Pro, Webzip, etc...) that are showed in the logs as "Mozilla"? Example: Webzip is showed in my site logs as "Mozilla/4.0 (compatible; MSIE 8.0; ...
2
votes
1answer
12k views

Increase the value of LimitRequestFieldSize in Apache

i have developed an application which uses a jQuery plugin, which in turn uses excess cookie data. the problem is after every 15-20 request i am shown this error message by the browser. Your ...
2
votes
1answer
129 views

using .htaccess, is there a way to allow access to a file only if current date is between 2 dates

For a company campaign, we want a page to be available only between 2 datess. There a way to allow access to a file only if current date is between 2 dates using .htaccess??
2
votes
1answer
3k views

Why is the RewriteBase not working?

Here is what I am trying to do: domain is thinkingmonkey.me domain has 127.0.0.1 as IP addr mod_alias is installed. I have a conf file called directories.conf. In which I have all the ...
2
votes
1answer
299 views

How to I interpret these htaccess rewrite rules

I was given a set or re-write rules for a new website. I've never used them before and I'm trying to understand what we are doing here RewriteEngine on RewriteCond %{HTTP_HOST} . RewriteCond ...
2
votes
2answers
6k views

How to correctly restrict access to some folders via htaccess?

I have such directiry structure: - www - folder1 - folder2 - folder21 - folder22 - folder23 I allowed all image files to be accessed <FilesMatch ...
2
votes
1answer
1k views

LAMP: Custom 500 error page - is it actually possible?

As the Question title suggests, I want to setup a custom 500 error. In fact, I want to use a .php file for the error, and ideally send a 503 response (SE Reasons). The problem is that the only way I ...
2
votes
1answer
5k views

Whats the use of BrowserMatch or Options All in .htaccess?

I found these somewhere at the end of my htaccess file, from a time in history where I was in a mood of just adding as much as i could to my htaccess, now wishing the opposite: to remove everything ...
2
votes
2answers
1k views

Optimized .htaccess for caching?

I'm trying to make Google PageSpeed happy, but my .htaccess skills are limited. I'm particularly struggling with browser and proxy caching. Does anyone have a template I can use? Here's what I have ...
2
votes
1answer
3k views

Convert HTACCESS mod_rewrite directives to nginx format?

I'm brand new to nginx and I am trying to convert the app I wrote over from Apache as I need the ability to serve a lot of clients at once without a lot of overhead! I'm getting the hang of setting up ...
2
votes
3answers
2k views

.htaccess to deny access to most xml files

I recently had a Joomla site hacked, so I'm trying to harden the site a bit. There's a section in the recommended .htaccess that restricts outside access to the xml files that come with extensions. ...
2
votes
1answer
130 views

unique .htaccess question about mod_rewrite and RewriteCond

I have a few rewrite rules like these RewriteRule ^dir/(.*)-something.html otherdir/file1.php?var1=val&var2=$1 [L,NC] RewriteRule ^dir/ otherdir/file2.php?var1=val [L,NC] dir/ is not a real ...
2
votes
4answers
2k views

.htaccess send requests to a subfolder's index.php

I have searched stackoverflow for my answer, but nothing that I have seen seems to work. I have a framework that sends all requests to an index.php file. Everything works when I install it in the ...
2
votes
2answers
374 views

.htaccess subdomain to directory issue

I have this code below which is supposed to redirect a subdomain to a directory in .htaccess. What I am trying to do is make it so that every user on my site has their profile located at ...
2
votes
4answers
11k views

How to prevent infinite redirect loop on htaccess?

Our domain.com/app/index.php is loading domain.com/blog in an iframe. So my redirect rules should be like; - domain.com/ => /app/index.php - domain.com/blog(.*) => ...
2
votes
2answers
538 views

How do I get Apache to use a different local PHP.ini for different domains?

is there some sort of .htaccess directive. I dont have access to httpd.conf. I have php5 in a fastcgi/cgi module. Multiple domains. But for some reason all the domains are pointing to the first ...
2
votes
2answers
3k views

.htaccess hide “last modified” and “parent directory”

I'm trying to get my .htaccess file to list all files in the current directory, hide the 'last modified' column and also remove the link to "Parent Directory" all in the 'fancy' style. My current ...
2
votes
1answer
52 views

Apache - protect a subdirectory but not the root

I have a website, it should be accessible by anyone, but one directory should request http authorization. I have added following lines to website.conf: <Directory ...
2
votes
1answer
386 views

Force SSL not working either with Joomla or htaccess

We have a multiple sites in Joomla. Following are the details. Hosted on domain mydomain.co.in, sub.mydomain.co.in. Amazon EC2 instance, behind load balancer. We have bought WildCard SSL certificate ...
2
votes
2answers
3k 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' ...
2
votes
2answers
376 views

RewriteRule only works if folder does not exist

Instead of directly accessing images, I need to use RewriteRule to redirect a set of images to be accessed via a script. A RewriteRule is used for it: RewriteRule ^Images/test/([^.\/]*)\.png ...
2
votes
1answer
73 views

Protecting Directory with .htaccess

Unfortunately with a product I rolled out, blackhatters found they could access an unprotected directory where I had the zip files. I use PHP to serve up those zips with readfile(), so normally in my ...