当我访问时,我尝试让我的网站运行 seo mysite.com/search/eminem/1/video.html 给我这个网址的结果 mysite.com/index.php?search=eminem&page=1&type=video 它向我显示了搜索页面,但没有结果,没有图像或 javascript 等。就像 css 和 js 没有实现
这是我的 .htacces 代码
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^search/(.*)/(.*)/(.*).html?$ index.php?search=$3&page=$2&type=$1 [L]
<IfModule mod_deflate.c>
<FilesMatch "\.(php|js|css|mp3|wmv|flv|html|htm)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
</IfModule>
最佳答案
您需要将所有相对链接(用于图像、CSS、JavaScript 等)设为带有前导斜杠的绝对链接,或者将其添加到 index.php 内容的标题中:
<base href="/">
关于.htaccess - Seo Url 和 .htaccess 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12663996/