php forum
php mysql forum
php mysql smarty
 
Topic Options
#285650 - 06/25/05 03:04 PM using .htaccess to redirect an entire domain
Mudpuppy Offline
Journeyman

Registered: 08/16/02
Posts: 113
Loc: Sin City
I was going to direct this to Josh, but as he's out of town on one of his oh-so-frequent vacations <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /> , I hope it's okay to ask it here.<br /><br />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:<br /><br />Redirect 302 / http://www.mytemporarysite.com/<br /><br />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. <br /><br />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?

Top
#285651 - 06/25/05 04:07 PM Re: using .htaccess to redirect an entire domain [Re: jbiz]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
Use this: <br /> <br />RewriteEngine on <br />RewriteRule (.*) http://www.mytemporarysite.com/

Top
#285652 - 06/25/05 04:22 PM Re: using .htaccess to redirect an entire domain [Re: domain123]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
A different approach would be to use your redirect:<br /><br />Redirect 302 / http://www.mytemporarysite.com/<br /><br />and on http://www.mytemporarysite.com/<br />you specify:<br /><br />ErrorDocument 404 /

Top
#285653 - 06/26/05 02:39 AM Re: using .htaccess to redirect an entire domain [Re: domain123]
Mudpuppy Offline
Journeyman

Registered: 08/16/02
Posts: 113
Loc: Sin City
[]Anno said:<br />Use this:<br /><br />RewriteEngine on<br />RewriteRule (.*) http://www.mytemporarysite.com/ [/]<br /><br />I used this one, and it worked perfectly. Thanks so much!

Top
#285654 - 06/26/05 03:22 AM Re: using .htaccess to redirect an entire domain [Re: jbiz]
Anno Offline
Code Monkey

Registered: 05/23/01
Posts: 562
Loc: Austria
You're welcome.

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks