【发布时间】:2012-11-20 20:03:17
【问题描述】:
我希望我的网址看起来像这样:“http://www.example.com/start”, 而不是这样:“http://www.example.com/index.php/start”。 这适用于我的 .htaccess 中的这段代码:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1
在一个页面上,我必须使用 GET-Parameters,url 应该如下所示: "http://www.example.com/artists/picasso", 而不是这样: “http://www.example.com/index.php/artists?artist=picasso” 也可以使用以下代码:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /index.php?/$1
RewriteRule ^artists/(.*)$ /index.php/artists?artist=$1 [L]
现在,这个解决方案的问题是,所有其他 url 现在必须以斜杠结尾。
所以它必须看起来像这样:“http://www.example.com/start/”,
而不是这样:“http://www.example.com/start”
感谢您的帮助!
【问题讨论】:
标签: .htaccess get seo rewrite query-string