Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
348 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
180 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
758 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
222 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
735 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
173 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
491 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
194 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
1k 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
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
7k 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
646 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
140 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
506 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
949 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
219 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
10k 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
117 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
2k 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
288 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
5k 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
4k 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
2k 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
1k 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
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
129 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
1k 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
373 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
2answers
532 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
2k 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
34 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
262 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
2k views

Invalid command 'AuthType', perhaps misspelled or defined by a module not included in the server configuration

I'm trying to password protect the document root and all I get is an "internal server error" page. The Apache error log shows: Invalid command 'AuthType', perhaps misspelled or defined by a module ...
2
votes
2answers
2k 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
5k 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 ...
2
votes
2answers
347 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
69 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 ...
2
votes
2answers
146 views

Apache 2 does not load mod_deflate

I'm running Apache 2 on a Redhat Enterprise Linux 5.8 x86_64 standard box, and can't seem to get mod_deflate enabled. This is a WHM installation, so I am making amendments to one of the include files ...
2
votes
2answers
129 views

How to serve different application & server based on cookie

I'm building the frontend marketing website for a web application. The frontend is WordPress on one server and the app is on another. We will set a cookie for users who are already customers. For ...
2
votes
2answers
82 views

Wordpress Website deploying challenge, remove “Allow from all” .htaccess

I am attempting to host my website. My host'er is telling me that they dont support "Allow from all" in .htaccess. Below are the contents of wp-content/.htaccess Order Allow,Deny Deny from all ...
2
votes
1answer
95 views

Consistent way to map .HTML as .PHP

We started including some PHP into our web pages, but we wanted to keep our incoming links working. Instead of a bunch of redirects, we simply mapped HTML files to PHP via: AddType ...
2
votes
1answer
50 views

.htaccess 301 redirect to new site

I want to redirect some of my old sites to my new sites. Some Googling suggest pasting this into my .htaccess: redirect 301 / http://new.com/ However, the new site does not have the same structure ...
2
votes
4answers
783 views

Htaccess strange behaviour with Nginx

I have a site running on Nginx (v1.0.14) serving as reverse proxy which proxies requests to Apache (v2.2.19). So Nginx runs on port 80, Apache is on 8080. Overall site works fine except that i cannot ...
2
votes
4answers
1k views

how to cache my website?

I have few questions about caching a website, since I haven't tried caching a site before. First is how to cache a site so it will have a faster loading when clients browse the site. For example I ...