分解它,这就是我的站点地图的样子。
http://website.com/home
http://website.com/contact
http://website.com/support
使用我的 index.php 处理程序处理 GET 语句 index.php?home、index.php?contact 和 index.php?support
目前,我的 .htaccess 看起来像这样:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /([^/]+)/?$ [NC]
RewriteRule .* index.php?%1 [L]
到目前为止,这很好用,但是它是有限的。我正在集成一个我用 PHP 设计的迷你博客,它可以接受查询字符串,如下所示:
http://site.com/blog.php?y=2013&m=02&d=12&title=welcome-to-site-blog
现在,我想保留网站的根文件结构并集成博客文件结构。希望看起来像这样:
http://site.com/2013/02/12/welcome-to-site-blog
任何帮助都会很棒。我知道条件语句是必需的,但我对 htaccess 几乎没有经验。
在此先感谢,克里斯