| shimmyshack 2007-01-06, 8:11 pm |
|
Nospam wrote:
> What do I need to add to htaccess to redirect certain files containing abc
> in the filename to another page, eg:
>
> RedirectMatch permanent ^(.*)abc\.html$ http://www.example.com/redirect.html
>
> would this redirect say http://www.example.com/abc23.html to
> http://www.example.com/redirect.html
>
> ?
and of course you need the control file to be called
.htaccess which is done in by default int he httpd.conf like so:
AccessFileName .htaccess
you also need to make sure .htaccess files are in operation
make sure this line is *not* in the httpd.conf
AllowOverride None
and that you can do the redirects at all which depends on mod_alias in
apache 2 liek so:
LoadModule alias_module modules/mod_alias.so
you dont need to specify the start of the string.
this would work:
RedirectMatch permanent abc\.html$ http://www.example.com/redirect.html
as this matches the end of the URI whatever the start.
|