homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
RewriteRule ^(.*)$ redirect and index page trouble.
Jesse_Smith




msg:3040614
 11:52 pm on Aug 9, 2006 (gmt 0)

Is there any way to have this code not mess up the index page?

RewriteRule ^(.*)$ http-//$1.id.hop.domain.net [R=301,L]
RewriteRule ^$ index.shtml [L]

it redirects to

http-//.id.hop.domain.net/

instead of showing the index.shtml file.

 

vincevincevince




msg:3040617
 12:04 am on Aug 10, 2006 (gmt 0)

Take the L out of the first line

abates




msg:3040621
 12:19 am on Aug 10, 2006 (gmt 0)

Change those to lines to:

RewriteCond %{REQUEST_URI}!index.shtml$ [NC]
RewriteRule ^(.*)$ http-//$1.id.hop.domain.net [R=301,L]

You could probably throw the following line in just to make sure:
RewriteCond %{REQUEST_URI}!=/ [NC]

Jesse_Smith




msg:3040631
 12:38 am on Aug 10, 2006 (gmt 0)

That then shows the index page at affiliates.domain.com and affiliates.domain.com/index.shtml but doesn't do the redirect at affiliates.domain.com/whatever

Just taking the L out of the first line made the browser go bonkers, searching and then redirecting to some other site!

Jesse_Smith




msg:3040694
 1:45 am on Aug 10, 2006 (gmt 0)

RewriteRule ([0-9a-zA-Z]+)$ http-://$1.id.hop.domain.net [R=301,L]

works.

[edited by: Jesse_Smith at 1:45 am (utc) on Aug. 10, 2006]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved