Re: [users@httpd] detail for a rewrite

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

 



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

RewriteCond %{HTTP_HOST}     !^www\.domain\.net [NC]
RewriteCond %{REQUEST_URI}   ^/o/.*
RewriteRule (.*)  /file.not.found.html     [R]

Works finally.  Changed the game plan a little too.

Any .com request for resource in the o directory is now redirected to
a message file.

But this works too:

RewriteRule (.*)  http://www.domain.net/o/$1    [R]

thanks!

Mike

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