httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] detail for a rewrite
Date Sun, 11 Dec 2005 15:35:24 GMT
On 12/11/05, T F <> wrote:

>  In my .htaccess file, the following accomplishes this (but there is a
> glitch)
>  RewriteEngine on
>  RewriteCond %{HTTP_HOST}   ^www\.domain\.net [NC]
>  RewriteRule ^$   [R]
>  If the user points to (with a trailing slash),
> then everything is fine.
>  But if they omit the trailing slash, then the url becomes (note the .com)

Fixing the UseCanonicalName setting could probably fix that, but it
sounds like you can't access httpd.conf.

>  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
>, then it would be
> rewritten to

In the o/.htaccess:
 RewriteEngine on
 RewriteCond %{HTTP_HOST}   !^www\.domain\.net$ [NC]
 RewriteRule (.*)$1  [R]
(or something like that -- untested).


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message