.htaccess 如何重新连接两个场景文件?
我有这样的权限:.htaccess 如何重新连接两个场景文件?,.htaccess,.htaccess,我有这样的权限: RewriteEngine On # http://site.com/ru,ua,lt/anything/ RewriteRule ^(ru|ua|lt)/([^/]+)/$ index.php?lang=$1&article_id=$2 # http://site.com/print/ru,ua,lt/anything/ RewriteRule ^print/(ru|ua|lt)/([^/]+)/$ print.php?lang=$1&article_id=$
RewriteEngine On
# http://site.com/ru,ua,lt/anything/
RewriteRule ^(ru|ua|lt)/([^/]+)/$ index.php?lang=$1&article_id=$2
# http://site.com/print/ru,ua,lt/anything/
RewriteRule ^print/(ru|ua|lt)/([^/]+)/$ print.php?lang=$1&article_id=$2
第一个例子有效,第二个不起作用。请帮助解决这个问题。什么不起作用?是否只有外部文件(JS、CSS、图像)不起作用
可能是这样的,因为您的第二个URL还有一个子目录。然后应该使用绝对URL路径链接到外部文件。什么不起作用?是否只有外部文件(JS、CSS、图像)不起作用
可能是这样的,因为您的第二个URL还有一个子目录。然后,您应该使用绝对URL路径链接到外部文件。首先将代码更改为:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
# http://site.com/ru,ua,lt/anything/
RewriteRule ^(ru|ua|lt)/([^/]+)/?$ index.php?lang=$1&article_id=$2 [L,NC,QSA]
# http://site.com/print/ru,ua,lt/anything/
RewriteRule ^print/(ru|ua|lt)/([^/]+)/?$ print.php?lang=$1&article_id=$2 [L,NC,QSA]
然后尝试您的URI,如果仍然不起作用,请报告。首先将代码更改为:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
# http://site.com/ru,ua,lt/anything/
RewriteRule ^(ru|ua|lt)/([^/]+)/?$ index.php?lang=$1&article_id=$2 [L,NC,QSA]
# http://site.com/print/ru,ua,lt/anything/
RewriteRule ^print/(ru|ua|lt)/([^/]+)/?$ print.php?lang=$1&article_id=$2 [L,NC,QSA]
然后尝试您的URI,如果仍然不起作用,请报告。我不理解这个问题。发布详细信息。我不理解这个问题。发布详细信息。不显示带有echo GET[lang]和GET[article_id]参数的print.php!不显示带有echo GET[lang]和GET[article_id]参数的print.php!