我正在本地开发一个应用程序(在域名<mydomain>.dev下)。
为了使用友好的 url,我设置了我的 .htaccess,如下所示:
RewriteEngine on
# Externally redirect to add missing trailing slash
RewriteRule ^(([a-z0-9._\-]+/)*[a-z0-9_\-]+)$ http://example.com/$1/?%{QUERY_STRING}[NC,R,L]
RewriteRule ^about/$ about.php [NC,L]
RewriteRule ^issues/$ issues.php [NC,L]
RewriteRule ^issue/([a-z0-9_\-]+)/$ issue.php?slug=$1 [NC,L]
SetEnv PHP_VER 5
IndexIgnore *
Options +FollowSymLinks
它工作正常。烦人的是,上网的时候就不是那么好了:
http://example.com/issue/my-slug/#23不返回 GET 变量。为什么?