Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a htaccess redirect (not rewrite) which will redirect this:


So, everything can be anything, like /./script.php or /./path/to/script.php.

I only want to redirect if there is the /./ slash dot slash. How can I do this without using mod_rewrite?

share|improve this question
why don't you want to use mod_rewrite? – Andbdrew Mar 30 '12 at 18:30
If you can't use mod_rewrite, which modules can you use? There is no native support for redirects, you have to use a module. – Chris S Mar 30 '12 at 18:33
Unfortunately mod_rewrite wasn't included when Apache installed so can't use it. Is there a way of doing it with the Redirect directive? – ServerBloke Mar 30 '12 at 18:36
@John See my previous comment. Without that information we can not help you. Redirect is part of mod_alias, was that installed??? – Chris S Mar 30 '12 at 18:41
@ChrisS I am only certain that mod_rewrite is missing. How can I verify if mod_alias is there? – ServerBloke Mar 30 '12 at 18:45
up vote 1 down vote accepted

You can do this without mod_rewrite by using RedirectMatch from mod_alias instead:

RedirectMatch 301 ^/\./(.*)$

The ^/\./ part of the regex matches the leading dot slash and the (.*)$ part collects everything else (if anything) until the end and throws it away.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.