homepage Welcome to WebmasterWorld Guest from 23.23.12.202
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

    
Rewriting any domain request
Am I on the right track?
wifi on the fly

10+ Year Member



 
Msg#: 1647 posted 2:26 am on Jun 8, 2004 (gmt 0)

Feels like day 10 on this.

I have a computer setup to take requests for non-paying customers. I can get to anywhere on mysub.domain.net, but if I try to go to www.abc.com Apache just hangs.

How do I tell Apache to take any request from any domain and throw them to this index.html?

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST}!^mysub.domain.net$
RewriteRule ^/(.*) [mysub.domain.net...] [L]
RewriteRule ^.*$ / [R=302,L]
</IfModule>

Will this even work?

 

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1647 posted 5:25 pm on Jun 9, 2004 (gmt 0)

I suspect that the reason Apache 'hangs' is that your second RewriteRule is unconditional, thus putting Apache into an 'endless' redirection loop. RewriteCond directives only apply to the first RewriteRule that follows them.

I don't understand why you have two RewriteRules -- You may have a good reason, but you didn't say why.

I would suggest:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^mysub\.domain\.net
RewriteRule ^/ http://mysub.domain.net/index.html [R=302,L]
</IfModule>

Jim

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