在我的网络应用程序中,htaccess能够翻译形式为
的seo友好网址/e-dmis/home
/e-dmis/system-admin/groups
/e-dmis/system-admin/standard-lists/accounting/COA
....
....
TO
/e-dmis/index.php?content=home
/e-dmis/index.php?content=system-admin/groups
/e-dmis/index.php?content=system-admin/standard-lists/accounting/COA
....
....
但是我遇到了需要使用jquery重定向到页面的情况。例如,
var root = location.protocol + '//' + location.host;
window.location.href=root+'/e-dmis/home';
令我惊讶的是, window.location.href
始终将我带到索引页面,即/e-dmis/index.php
- 删除'content'参数。
非常感谢您的协助,因为它将缩短网上关于此的谷歌搜索时间
这是.htaccess文件:
Options -MultiViews
# Turn on rewriting
RewriteEngine On
# Starting with /e-dmis
RewriteBase /e-dmis
# If there's no file that matches the request
RewriteCond %{REQUEST_FILENAME} !-f
# *nor* a directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)/?$ index.php?content=$1 [L,QSA]