GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Quick .htaccess question.. redirecting people.. help (https://gfy.com/showthread.php?t=548233)

xxweekxx 12-05-2005 07:24 AM

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?

woj 12-05-2005 07:28 AM

yes, I don't feel like writing it up though, heh
maybe someone else will do it, so here is a bump...

xxweekxx 12-05-2005 07:34 AM

lol u suck

ABC-Celebs 12-05-2005 07:34 AM

Redirect index.html http://mysite.com

Index.html should be your default first page.

fetishblog 12-05-2005 07:38 AM

Something like this might work.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*$ http://yourdomain.com [R,NC]

xxweekxx 12-05-2005 07:39 AM

that wont work..

bcuz IM TRYING TO redirect http://www.mysite.com/index.html to
http://mysite.com/index.html


wont work..

ABC-Celebs 12-05-2005 07:41 AM

Quote:

Originally Posted by xxweekxx
that wont work..

bcuz IM TRYING TO redirect http://www.mysite.com/index.html to
http://mysite.com/index.html


wont work..

Have you tried
Redirect index.html http://mysite.com/index.html ?

xxweekxx 12-05-2005 07:42 AM

Quote:

Originally Posted by fetishblog
Something like this might work.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*$ http://yourdomain.com [R,NC]



didnt work

xxweekxx 12-05-2005 07:43 AM

Quote:

Originally Posted by ABC-Celebs
Have you tried
Redirect index.html http://mysite.com/index.html ?

didnt work just made it go crazy, dont forget the index.html in www.mysite.com is the same index.html on mysite.com/index.hml

so it just kept refreshing from one to other non stop

Scotty.T 12-05-2005 07:44 AM

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.

Tempest 12-05-2005 07:47 AM

Usually people want to do it the other way around... Got code to do that, but not what you're asking for..

xxweekxx 12-05-2005 07:47 AM

hmmwont work for me

mkx 12-05-2005 07:49 AM

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?

mkx 12-05-2005 07:50 AM

oh nevermind, thought it was the other way around

xxweekxx 12-05-2005 07:52 AM

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?

ABC-Celebs 12-05-2005 07:53 AM

mmm...so strange!
Try

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.com [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]

xxweekxx 12-05-2005 07:55 AM

that worked! thanks man

ABC-Celebs 12-05-2005 07:56 AM

Quote:

Originally Posted by xxweekxx
that worked! thanks man


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