mod_rewrite redirect to local path issue

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

 



Hi-

I am using mod_rewrite to redirect from a sub-directory of my existing domain to a new domain just for this section.

Here is my .htaccess file in /othersite/ (specific domains and paths hidden):

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /othersite/

    RewriteRule ^(.*)$ http://<myotherwebsite>.com/$1 [R=301,L]
</IfModule>

When I go to <mycurrentwebsite>.com/othersite/ (or any file within this directory) it redirects perfectly fine. The strange part is when I go to <mycurrentwebsite>.com/othersite (with no trailing slash), I get redirected to <myotherwebsite>.com//var/www/<mycurrentsite>.com/web/othersite/. Apache for some reason replaces the $1 with the local path, which is a major security issue. I would rather not have my server paths revealed in this way.

I couldn't figure out how to fix this issue, so as a temporary "hacked" solution by forcing a redirect from "/var/www..." to "/" using mod_rewrite. This is a very poor work around since my path is still being revealed behind the scenes.

All my Google searches have turned up empty. Any help would be appreciated.

I am running Apache Version 2.0.52 on CentOS 4.6

Thanks!

- Steven Bower

[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