PHP的:搜索引擎友好的URL [英] php : SEO friendly urls
本文介绍了PHP的:搜索引擎友好的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我工作的一个新的项目,我想创建搜索引擎友好的URL这个网站像
I am working on a new project, I want to create SEO friendly URL's for this site like
mysite.com/first_content,mysite.com/second_content。的URL必须是动态的,这意味着网址的必备相关的内容的标题。我怎么能这样做呢?是有可能使用htacess,?
mysite.com/first_content, mysite.com/second_content. URL's must be dynamic which means URL's must related to the content title. How can I done this ? Is is possible to use htacess, ?
感谢
推荐答案
有关的.htaccess样品规则(一旦你确定mod_rewrite的启用):
Sample rules for .htaccess (once you make sure mod_rewrite is enabled):
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?page=$1 [L]
这些规则相匹配,是不是已经存在的文件,并把它传递到脚本的任何URL。
These rules match any URL that isn't an already existing file and passes it to your script.
这篇关于PHP的:搜索引擎友好的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文