如何跳过href =“”中的.htaccess规则

时间:2019-07-26 10:22:04

标签: .htaccess mod-rewrite

我正在用php mvc开发应用程序,由于.htaccess添加了默认的“ localhost / sitename /”,因此我无法使用href。我想指向外部站点,但是html href =“#”最终是“ localhost / sitename/#"。

我该如何解决?

1)根文件夹中的.htaccess:

RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]

2)公用文件夹中的.htaccess:

Options -Multiviews
RewriteEngine On
RewriteBase /sitename/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?$1 [QSA,L]

0 个答案:

没有答案