Re: [users@httpd] detail for a rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/11/05, T F <through.the.forest@xxxxxxxxx> wrote:

>  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/

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
> http://www.domain.com/o/file.html, then it would be
> rewritten to http://www.domain.net/o/file.html

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

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux