mod_rewrite and";“漂亮的URL”;
我对使用mod_rewrite来创建干净、SEO友好的URL装备不足,但我真的决心学习。我找到了各种在线教程,但似乎无法真正理解这些信息,无法以我喜欢的方式进行操作mod_rewrite and";“漂亮的URL”;,url,mod-rewrite,seo,Url,Mod Rewrite,Seo,我对使用mod_rewrite来创建干净、SEO友好的URL装备不足,但我真的决心学习。我找到了各种在线教程,但似乎无法真正理解这些信息,无法以我喜欢的方式进行操作 I have a home page: http://mysite.com/index.html which I would like to display as: http://mysite.com/home 同样,我有子目录: http://mysite.com/about/index.html http://mysite.
I have a home page: http://mysite.com/index.html
which I would like to display as: http://mysite.com/home
同样,我有子目录:
http://mysite.com/about/index.html
http://mysite.com/contact/index.php
Which I would like to display as
http://mysite.com/about
and http://mysite.com/contact
和不同产品的图库部分,每个产品都有一个独特的页面,例如:
http://mysite.com/products/happybunnies.html OR
http://mysite.com/products/sillytigers.html
That I want to display as:
http://mysite.com/products/happy-bunnies/ AND
http://mysite.com/products/silly-tigers/
最后一个对我来说是最重要的。如果有人能慷慨地解释:
RewriteEngine on
RewriteCond %{QUERY_STRING} =m=1
RewriteCond %{REQUEST_URI} =/index.html
RewriteRule ^.* /home? [R=301]
RewriteRule ^home /index.html?m=1 [QSA]
试一试,看看它对你有什么好处