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)
-   -   301 redirect help (https://gfy.com/showthread.php?t=1074558)

OneHungLo 07-13-2012 08:59 PM

301 redirect help
 
I have an old site that I want to redirect into another site.

I have this on my old site:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newsite.com/$1 [R=301,L]

With this, whenever you visit a url from the old site, for example: www.oldsite.com/hello.html it redirects to www.newsite.com/hello.html

How to I set it up to redirect www.oldsite.com/whatever.html to
www.oldsite.com/

?

Thanks

papill0n 07-13-2012 09:06 PM

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

OneHungLo 07-13-2012 09:23 PM

Thanks, but that's not cutting it.

I forgot to mention there are no urls on the server of the olddomain.com

There used to be but not anymore and I need to 301 these all into my newdomain.com

Do I need to specify in the redirect all the urls on the old domain if they are not there?

Everything im trying is just redirecting olddomain.com/oldurl.html to newdomain.com/oldurl.html

papill0n 07-13-2012 09:37 PM

this works for me here

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

OneHungLo 07-13-2012 09:40 PM

Quote:

Originally Posted by papill0n (Post 19058436)
this works for me here

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Yeah, I have that, and when I visit http://www.olddomain.com/ it goes to http://www.newdomain.com/ which is fine, but when I visit http://www.olddomain.com/whatever.html it goes to http://www.newdomain.com/whatever.html

I need it to redirect http://www.olddomain.com/whatever-url-someone-hits.html to http://www.newdomain.com/

papill0n 07-13-2012 09:49 PM

ok you should put a 404 on the old domain that redirects everything to the root first :)


All times are GMT -7. The time now is 10:03 PM.

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