I need to redirect all Url which contain "forums" in address bar!!
Like:http://www.sportsinjuryclinic.net/blog/forums/ to http://www.sportsinjuryclinic.net Can any one help me to do that redirection?
Thanks
I need to redirect all Url which contain "forums" in address bar!!
Like:http://www.sportsinjuryclinic.net/blog/forums/ to http://www.sportsinjuryclinic.net Can any one help me to do that redirection?
Thanks
You will need to use Mod_rewrite and a regex to check for the "forums" string. Here is an example of what you're looking for. mod_rewrite rule: if URL contains a certain string
If /blog/
is a directory then place this rule in /blog/.htaccess
:
RewriteEngine On
RewriteBase /blog/
RewriteRule ^forums(/.*)?$ / [L,NC,R=302]
For handling /forums/ place this rule in
DocuementRoot/.htaccess`:
RewriteEngine On
RewriteRule ^forums(/.*)?$ / [L,NC,R=302]
Once you verify it is working fine, replace R=302
to R=301
. Avoid using R=301
(Permanent Redirect) while testing your mod_rewrite rules.