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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rewrite root to specific page

Status
Not open for further replies.

Geronantimo

Technical User
Apr 3, 2006
79
SE
Is it possible to rewrite the root to a specific page?

I would like the visitor coming to to be automatically taken to
I have tried various things, but they don't work.

Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^([URL unfurl="true"]www\.)?domain\.com$[/URL] [NC]
RewriteRule ^ [URL unfurl="true"]http://www.domain.com/new-page.html[/URL] [R=301,L]

The trouble is that all pages within domain.com are being rewritten.

Is it possible to rewrite only the root url?

In other words, can I rewrite
to but still have the page available in the normal way?
 
After a final last ditch attempt, I have found that this seems to be working ...

Code:
RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^([URL unfurl="true"]www\.)?domain\.com$[/URL] [NC]
RewriteRule ^$ /new-page.html [L]

Can anybody see anything wrong with it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top