.htaccess redirect to subfolder?
I have a site that works on jQuery and full ajax (1 page design) and I'm trying to redirect the users from the root of my site www.mysite.com
to subfolder www.mysite.com/my/subfolder/
. I have tried the following from a past question:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC,OR]
RewriteCond %{REQUEST_URI} / [NC]
RewriteRule ^(.*)$ /my/subfolder/$1 [L,QSA]
It redirects properly but for some reason JavaScript is not working. Any advice?
Make sure your javascript paths etc are all still valid after the url gets re-written
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my/subfolder/$1 [L]
This would route your page to the /my/subfolder/. It's a simplified version of what you have but works for me.
精彩评论