我试图为我的主页创建一个搜索引擎优化友好的网址。例如,我希望example.com?url=hello-world变成example.com/hello-world。我现在的.htaccess有以下几个特性:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
它可以正确地删除.php文件扩展名,但是我怎样才能让它也能为主页生成一个搜索引擎优化友好的url呢?该文件为index.php。
https://stackoverflow.com/questions/41390397
复制相似问题