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)
-   -   How do I redirect www.domain.com to domain.com? (https://gfy.com/showthread.php?t=604387)

Snake Doctor 05-01-2006 01:15 PM

How do I redirect www.domain.com to domain.com?
 
I've heard you can do this in htaccess but I don't know the code.
Anyone have it handy?

Thanks

cranki 05-01-2006 01:33 PM

this is from domain to www.domain ... maybe just switch it vice versa...

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

madawgz 05-01-2006 01:36 PM

Quote:

Originally Posted by cranki
this is from domain to www.domain ... maybe just switch it vice versa...

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

whoa, some complicated scripting you got there :upsidedow

Quickdraw 05-01-2006 01:46 PM

There is more than one way, but I believe this should work

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
rewriterule (.*) http://domain.com/$1 [R=permanent,L]


All times are GMT -7. The time now is 11:42 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123