View Full Version : .htaccess-redirecting a subforum question
RichieBoy67
05-29-2009, 12:22 PM
Hey all, I hope someone can help me with this..
I just removed a sub domain from a site and I want to redirect the sub domain's path to the root directory....
This is what I came up with but it doesn't seem to be working. What am I missing?
RewriteCond %{HTTP_HOST} subdomain.mysite.com
RewriteCond %{REQUEST_URI} !mysite.com/
RewriteRule ^(.*)$ mysite.com/$1 [L]
Thank you guys so much,
Rich
UKBusinessLive
05-29-2009, 12:52 PM
Hey all, I hope someone can help me with this..
I just removed a sub domain from a site and I want to redirect the sub domain's path to the root directory....
This is what I came up with but it doesn't seem to be working. What am I missing?
RewriteCond %{HTTP_HOST} subdomain.mysite.com
RewriteCond %{REQUEST_URI} !mysite.com/
RewriteRule ^(.*)$ mysite.com/$1 [L]
Thank you guys so much,
Rich
Hi Rich In .htaccess files to use the rewrite condition you need to add above it
ReWriteEngine On
Give that a go, but it it don't work, try the code i've done below instead, let me know mate
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?subdomain.mysite.com$ [NC]
RewriteRule ^same/(.*) http://$1.mysite.com[R=301,L]
:up:
RichieBoy67
05-29-2009, 01:16 PM
Thanks,
yeah, I actually already have that.. sorry I didn't show it here but I will try everything else you changed..
Thank you so much Mr UK!!
UKBusinessLive
05-29-2009, 01:18 PM
Thanks,
yeah, I actually already have that.. sorry I didn't show it here but I will try everything else you changed..
Thank you so much Mr UK!!
No worries let me know if that works or not sometimes .htaccess codes can clash dependant what else you have in it.
:D;)
RichieBoy67
05-29-2009, 11:23 PM
Thanks--It didn't work actually so I created a simple page with a meta redirect for now. I believe it probably is because of other items on the htaccess file. I will post them when I have a chance. I appreciate your advice and help.
Thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.