【发布时间】:2014-04-23 08:11:16
【问题描述】:
我正在尝试像这样重定向 URL
http://localhost/web/gallery/dogs
到
http://localhost/web/index.php?section=gallery&name=dogs
为此,我尝试使用下一个 .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>
我有下一个问题,如果我手动编写 URL,它看起来很好,并且 CSS 正确且没有错误。否则,如果我使用第一个 URL,firefox 会给我 CSS 和其他文件的 MIME 类型错误,所以,它看起来就像一个没有颜色的旧网页。
没有人知道我该如何解决这个问题?
谢谢!!
编辑:
我现在正在网上尝试,结果也是一样。我什么都没改变。
如果我尝试这个网址
http://alexander.comyr.com/gallery&name=Historias_del_mar
一切顺利,否则,试试这个:
http://alexander.comyr.com/gallery/Historias_del_mar
它不能正常工作
【问题讨论】:
标签: php css .htaccess redirect mime