Welcome to WebmasterWorld Guest from 54.167.40.25

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Rewriting any domain request

Am I on the right track?

     
2:26 am on Jun 8, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 9, 2003
posts:60
votes: 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?

5:25 pm on June 9, 2004 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 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