Hello all. I'm looking for the appropriate way to chain/link rewrite rules from one directory to another. So, suppose I have the following directory structure:
I would like to place a rewrite rule in /home/jon/public_html/.htaccess which rewrites URLS to load from /home/jon/public_html/some_directory. From there, I need the request to also be handled by any rewrite rules that happen to appear in /home/jon/public_html/some_directory/.htaccess.
Currently, /home/jon/public_html/.htaccess looks something like this:
# SymLinks needs to be on ...
# Turn rewriting on ...
# Rewrite us into the correct directory.
# Change this as necessary.
RewriteRule ^(.+)$ some_directory/$1 [QSA]
And /home/jon/public_html/some_directory/.htaccess looks something like this:
# URL Rewriting
# set this to your project's visible directory
# add a line like this for every directory you wish to be
# served/parsed directory (not via index.php)
RewriteRule ^images/ - [L,QSA]
# all (most) pages should be served via index.php.
RewriteRule ^$ index.php [L,QSA]
RewriteRule ^/$ index.php [L,QSA]
RewriteRule ^(.+)/$ index.php?page=$1/index [L,QSA]
RewriteRule ^/([^.]+)$ index.php?page=$1 [L,QSA]
RewriteRule ^/(.+)\.([^.]*)$ index.php?page=$1&theme=$2 [L,QSA]
Currently, when I make a request like http://localhost/~jon/something, I get a 404 like this:
The requested URL /~jon/some_directory/something was not found on this server.
So, it's clear that the rewrite rules in /home/jon/public_html/some_directory/.htaccess aren't taking effect. Should by RewriteBase be different for that file? Or, is there a trick I need here to get this working?