简体   繁体   English

Joomla上的htaccess重定向循环

[英]htaccess redirect loop on joomla

I have all of my customers sites in a directory on my subdomain: 我的所有客户网站都位于我的子域的目录中:

customers.example.com/sites/customer_name

I have rewritten the url from: 我改写了以下网址:

customers.example.com/sites/customer_name

to: 至:

customers.example.com/customer_name

the problem is when i go to a joomla site, it makes a redirect loop, resulting in this address: http://customers.example.com/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/sites/customername// 问题是当我转到joomla网站时,它会导致重定向循环,并导致以下地址: http : //customers.example.com/sites/sites/sites/sites/sites/sites/sites/sites/sites/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点/站点名称//

my redirect works fine on static pages 我的重定向在静态页面上工作正常

Here is my current .htaccess file in the root of my domain: 这是我当前的.htaccess文件,位于我的域的根目录中:

EDIT: 编辑:

found a better htaccess script which is faster, but stil gives me the same issue 找到了一个更好的htaccess脚本,它更快,但是stil给了我同样的问题

RewriteEngine On
ErrorDocument 404 http://example.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /sites/$1/ [L]

在第二行将L更改为NL。

Because joomla is probably doing routing, the two condition checks !-f and !-d will fail because joomla needs to route. 由于joomla可能正在路由,因此两个条件检查!-f!-d将失败,因为joomla需要路由。 Try changing the conditions to: 尝试将条件更改为:

RewriteCond %{REQUEST_URI} !^/sites/
RewriteRule ^(.*)$ /sites/$1 [L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM