Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.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
Php htaccess条件会破坏其他图像和页面_Php_.htaccess - Fatal编程技术网

Php htaccess条件会破坏其他图像和页面

Php htaccess条件会破坏其他图像和页面,php,.htaccess,Php,.htaccess,我使用下面的htaccess代码,因此当用户键入www.current_website.com/go或www.current_website.com/go/时,他们会转到另一个网站www.other_website.com RewriteRule go http://www.other_website.com RewriteRule go/ http://www.other_website.com 问题在于logo.jpg图像,因为它包含的go没有出现 logout.php页面(也包含go)在

我使用下面的htaccess代码,因此当用户键入www.current_website.com/go或www.current_website.com/go/时,他们会转到另一个网站www.other_website.com

RewriteRule go http://www.other_website.com
RewriteRule go/ http://www.other_website.com
问题在于logo.jpg图像,因为它包含的go没有出现 logout.php页面(也包含go)在当前_网站中访问时,会转到www.other_website.com

RewriteRule go http://www.other_website.com
RewriteRule go/ http://www.other_website.com

如何解决这一问题?

您需要通过将它锚定到起点和终点来确保
go
就是全部。我还将斜杠设置为可选,因此您只需要1条规则:

RewriteRule ^go/?$ http://www.other_website.com
                 ^ the end of the path
               ^^ optional slash
            ^ the start of the path
也许可以用

RewriteRule http://www.current_website.com/go http://www.other_website.com
RewriteRule http://www.current_website.com/go/ http://www.other_website.com