Forum Moderators: phranque
RewriteCond %{HTTP_HOST} !^http://(www\.)?example-alias\.net$ [NC]
RewriteRule ^$ /samplepage.php [L]
This is working but it is also causing http://example.com to show http://www.example.com/samplepage.php as well. Is there any way I can stop this. I want http://example.com to stay as it was displaying the regular index.htm page.
Thanks a lot for any help.
[edited by: jdMorgan at 12:54 pm (utc) on Oct. 7, 2009]
[edit reason] exmaple->example [/edit]
It negates the expression "is not expression" and it contains parts which aren't present in a Host request header.
RewriteCond %{HTTP_HOST} ^(www\.)?example-alias\.net [NC]
RewriteRule ^$ /samplepage.php [L] In the feature one can get rid of mod_rewrite and could use
<If "$req{Host} = '/^(www\.)?example-alias\.net/'">
DirectoryIndex samplepage.php
</If>
Also, from your described requirements, it looks like you should not be negating the RewriteCond pattern with "!".
Jim