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

   using .htaccess to redirect an entire domain to Del.icio.us Add to del.icio.us
  Digg using .htaccess to redirect an entire domain Digg it
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


Top Posters Last 30 Days
AllenAyres 12
Gizmo 10
S7ARBVCK 2
Cambridge 1
Murphdog 1
MattUK 1
Kevin H 1
Who's Online
1 Registered (mikey81), 26 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
BeyondCompare v3.00
by blaaskaak
Yesterday at 02:46 PM
Noob - need help, or a reality check!
by Gizmo
09/04/08 03:21 AM
Here I am! Rock me like a Hurricane!
by AllenAyres
09/02/08 03:05 PM
[7.x] Generic Page Outside of forum directory
by Gizmo
08/30/08 05:43 PM
Team UBBDev Rides Again!
by Gizmo
08/28/08 11:45 PM
Multiple Identity Detector
by MattUK
08/28/08 04:10 PM
[7.3.x] ubb.links
by AllenAyres
08/26/08 09:57 AM
New Mods
Installing FlashChat with 7.3
by Paug
08/23/08 12:14 AM
[7.3.x] ubb.links
by AllenAyres
06/20/08 11:50 PM
[7.2.1] - Naked shoutbox
by sirdude
08/17/07 10:36 PM
[7.x] Generic Page Outside of forum directory
by
01/14/07 10:58 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
veedubb8, twentyseven, Claus1, welcomeback1, Paug
13327 Registered Users

 

 

 
fusionbb message board php hacks