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


Who's Online
0 registered (), 23 Guests and 12 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Wisdom needed
by Gizmo
Today at 10:54 AM
How to hide sub forums from summary page
by blaaskaak
Yesterday at 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
Truth, David DelMonte, nick1, Begbie, cenk
13364 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks