开发者

.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:

开发者_StackOverflow中文版
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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜