Suppose / is the root of a document in my example.com domain.
/.htaccess
RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
/dir/.htaccess
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /dir/index.php [L] </IfModule>
I know how to redirect example.com/dir to www.example.com/dir because /.htaccess does the job.
However, the trick is that I have to support /dir/.htaccess to serve virtual directories (e.g. /dir/state/AK/35827/ which are not actual directories) if you know what I mean.
The problem is that if I save /dir/.htaccess , the request is:
http://example.com/dir/state/AK/35827/
NOT redirected to:
http://www.example.com/dir/state/AK/35827/
:
http:
redirect to:
http:
Not sure if I'm clear.
Basically, how to make http://example.com/dir/state/AK/35827/ redirect correctly to http://www.example.com/dir/state/AK/35827/ and I can serve virtual URLs ?
source share