Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect all requests to page on same domain

Status
Not open for further replies.

Foamcow

Programmer
Nov 14, 2002
6,092
GB
Can anyone tell me how to redirect all requests on a domain to a particular page (not index.html) on the same domain?

Obviously using

Code:
Redirect 301 / /newpage.html

or
Code:
RewriteRule (.*)/ /newpage.html

Throws it into a loop and fails.

I am trying to use RewriteCond like so
But I'm having trouble getting the format correct
Code:
RewriteCond %{REQUEST_FILENAME} !newpage.html
RewriteRule (.*)/ /newpage.html

Thanks

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
I think I've managed it. This seems to work

Code:
RewriteCond %{REQUEST_FILENAME} !=(suspended) [NC]
RewriteRule ^(.*)$ suspended.html

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top