httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From T F <through.the.for...@gmail.com>
Subject [users@httpd] detail for a rewrite
Date Sun, 11 Dec 2005 08:28:59 GMT
My hosting service has my second domain name aliased to my single account.

For example, www.domain.net is aliased to www.domain.com

If a user points their browser to www.domain.com, then they are served
www.domain.com/index.html

If the they point to www.domain.net, then they are served
www.domain.net/o/index.html

In my .htaccess file, the following accomplishes this (but there is a
glitch)

RewriteEngine on
RewriteCond %{HTTP_HOST}   ^www\.domain\.net [NC]
RewriteRule ^$   http://www.domain.net/o/index.html   [R]

If the user points to http://www.domain.net/o/ (with a trailing slash), then
everything is fine.

But if they omit the trailing slash, then the url becomes (note the .com)
http://www.domain.com/o/

I'd like for the url to remain .net.

In fact, i'd like to devise a general solution, such that whenever any
document in the the /o tree is requested, then the url will be rewritten to
the .net.  For example if the user pointed http://www.domain.com/o/file.html,
then it would be rewritten to http://www.domain.net/o/file.html

I've tried a number rewrite conditions and rules, and have consulted
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Any help would be greatly appreciated.

Thanks in advance,
Mike

Mime
View raw message