Php .htaccess重定向,MIME错误

Php .htaccess重定向,MIME错误,php,css,.htaccess,redirect,mime,Php,Css,.htaccess,Redirect,Mime,我正试图像这样重定向URL http://localhost/web/gallery/dogs 到 为此,我尝试使用next.htaccess RewriteBase / <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^gall

我正试图像这样重定向URL

http://localhost/web/gallery/dogs

为此,我尝试使用next.htaccess

RewriteBase /

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^gallery/(.*)$ index.php/?section=gallery&name=$1 [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/?section=$1 [L]

</IfModule>
它进展顺利,否则,试试这个:

http://alexander.comyr.com/gallery/Historias_del_mar

它无法正常工作

听起来您需要将CSS链接设置为绝对链接,以便它们以
/web/
开头,或者将相对URI基添加到页面的标题中:

<base href="/web/" />

看起来你的css文件正在被重写

在您的页面上,CSS文件重定向到。他们应该去

因此,我会尝试从重写中排除CSS文件,比如在规则中添加以下条件:

ReWriteCond %{REQUEST_URI} !^.*\.css$
<base href="/web/" />
<base href="/" />
ReWriteCond %{REQUEST_URI} !^.*\.css$