获得htaccess的重写我的链接,这样更好的搜索引擎优化:
选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{REQUEST_URI} * /([^ /] +)/? [NC]
的RewriteCond%{REQUEST_URI}!指数 .PHP [NC]
重写规则。* /index.php?cat=%1 [L,NC,QSA]
这重写
http://www.example.com/any/number/of/directories/lastDir
到
http://www.example.com/index.php?cat=lastDir
但我的CSS心不是工作,当我上传htaccess的到服务器上,也只是没有图像和css纯文本
尝试添加基本标记转换为HTML,但它不工作
<基地的HREF =http://www.example.com/>
解决方案
尝试使用
选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{REQUEST_URI} * /([^ /] +)/? [NC]
的RewriteCond%{REQUEST_URI} ^!(指数 .PHP |机器人 .TXT |张图片|字体| JS | CSS |脚本)[NC]
重写规则。* /index.php?cat=%1 [L,NC,QSA]
这将过滤掉某些类型的文件和目录,以确保资产不被重定向
Got htaccess rewriting my links for better seo like this:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} .*/([^/]+)/? [NC]
RewriteCond %{REQUEST_URI} !index.php [NC]
RewriteRule .* /index.php?cat=%1 [L,NC,QSA]
which rewrites
http://www.example.com/any/number/of/directories/lastDir
to:
http://www.example.com/index.php?cat=lastDir
but my css isnt working, when i upload htaccess to the server, there is just plain text without images and css
tried adding base tag into html, but its not working
<base href="http://www.example.com/">
解决方案
try using
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} .*/([^/]+)/? [NC]
RewriteCond %{REQUEST_URI} !^(index.php|robots.txt|img|font|js|css|scripts) [NC]
RewriteRule .* /index.php?cat=%1 [L,NC,QSA]
this will filter out certain file types and directories to make sure that assets are not redirected
上一篇:Fishpig字preSS的Magento - http://site.com/blog解析为www.site.com而不是www.site.com/blog而不是、Magento、http、Fi