I'm looking for a htaccess redirect (not rewrite) which will redirect this:
site.com/./everything
To
site.com/
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?
You can do this without
mod_rewrite
by usingRedirectMatch
frommod_alias
instead: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.