Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
I was going to direct this to Josh, but as he's out of town on one of his oh-so-frequent vacations , I hope it's okay to ask it here.

I'm currently modifying about 25 domains to comply with the new enforcement of the 2257 law (it's a law which applies to adult webmasters). Until I've finished modifying a domain, I'd like to redirect everything on that domain to another site which is already in compliance. I want to use a .htaccess file to do this, but the one I'm using currently isn't working correctly:

Redirect 302 / http://www.mytemporarysite.com/

I want the redirect to work on every page and subfolder and pages in subfolders on my old domain. I just want all 5000+ pages and subfolders on my old domain to ALL be redirected to the index page of www.mytemporarysite.com. As I've got it now, the .htaccess file is only redirecting the main index page of the domain, i.e. mycurrentsite.com/index.html. If I try to access any other page on that domain, I just get a 404 error.

So, is there a way to use .htaccess to force every single page on a domain to be redirected to a single page on another site, without listing every page or subfolder individually?

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Use this:

RewriteEngine on
RewriteRule (.*) http://www.mytemporarysite.com/

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
A different approach would be to use your redirect:

Redirect 302 / http://www.mytemporarysite.com/

and on http://www.mytemporarysite.com/
you specify:

ErrorDocument 404 /

Joined: Aug 2002
Posts: 111
Journeyman
Journeyman
Offline
Joined: Aug 2002
Posts: 111
[]Anno said:
Use this:

RewriteEngine on
RewriteRule (.*) http://www.mytemporarysite.com/ [/]

I used this one, and it worked perfectly. Thanks so much!

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
You're welcome.

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)