Php htaccess条件会破坏其他图像和页面
我使用下面的htaccess代码,因此当用户键入www.current_website.com/go或www.current_website.com/go/时,他们会转到另一个网站www.other_website.comPhp 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)在
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