Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 如何重新连接两个场景文件?_.htaccess - Fatal编程技术网

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