我拥有这个网站:http://www.finalyearondesk.com。 我想更改网址: http://www.finalyearondesk.com/index.php?idname=how-to-recover-ubuntu-after-it-is-crashed 这样的事情: finalyearondesk.com/posts/how-to-recover-ubuntu-after-it-is-crashed 使用.htaccess。我对.htaccess没有任何了解,我尝试了很多在线提供的教程,但所有的努力都是徒劳的。 所以告诉我如何做到这一点。
答案 0 :(得分:2)
使用以下内容创建.htaccess
文件:
RewriteEngine On
RewriteRule ^posts/([^/]*)$ /index.php?idname=$1 [L]
如果它不起作用,请检查文件是否以点开头,您的主机允许您使用.htaccess文件或尝试添加Options +FollowSymLinks
:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^posts/([^/]*)$ /index.php?idname=$1 [L]