views:

15

answers:

1

I'm trying to map/mask a subfolder to a different folder on the same server. I've done it plenty of times before but I can't get this to work properly. I want the user who accesses directory "a" to see "oldsite/a" instead, but I do NOT want them to be redirected, or to see the new address in the browser.

<IfModule mod_rewrite.c>
        RewriteEngine on
        Options +FollowSymlinks
        RewriteRule ^\.htaccess$ - [F]
        # Maintain support for old structure
        RewriteRule ^a/([0-9]+)$  oldsite/a/$1?redirected=1 [QSA,L]
</IfModule>

I've tried various combinations with RewriteBase, etc. Instead of the user seeing "domain.com/a/1234" they are redirected to "domain.com/oldsite/a/1234?redirected=1".

A: 

Turns out the statement was missing a closing forward-slash before the query string.

RewriteRule ^a/([0-9]+)$  oldsite/a/$1/?redirected=1 [QSA,L]
BotskoNet