![]() |
Quick .htaccess question.. redirecting people.. help
Hey guys, i would like to redirect everyone that comes to
http://www.mysite.com to http://mysite.com can i do that with .htaccess? |
yes, I don't feel like writing it up though, heh
maybe someone else will do it, so here is a bump... |
lol u suck
|
|
Something like this might work.
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC] RewriteRule .*$ http://yourdomain.com [R,NC] |
that wont work..
bcuz IM TRYING TO redirect http://www.mysite.com/index.html to http://mysite.com/index.html wont work.. |
Quote:
Redirect index.html http://mysite.com/index.html ? |
Quote:
didnt work |
Quote:
so it just kept refreshing from one to other non stop |
RewriteCond %{HTTP_HOST} ^yourdomain.com$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] Works for me. Sorry. Just realised it was the other way you want to go. Not sure of the exact syntax for that. |
Usually people want to do it the other way around... Got code to do that, but not what you're asking for..
|
hmmwont work for me
|
i think it is your dns configuration from your domain name registrar. Make sure that * is going to the same as www, hard to explain off hand, what registar are you using?
|
oh nevermind, thought it was the other way around
|
yea,
what im trying to do is foward everyone that hits http://www.mysite.com to http://mysite.com wow nobody knows this on gfy? |
mmm...so strange!
Try RewriteEngine on RewriteCond %{HTTP_HOST} ^www.mydomain.com [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] |
that worked! thanks man
|
Quote:
np :winkwink: |
| All times are GMT -7. The time now is 05:29 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123