问题原文
原帖链接 · Grumpy ol' Bear · CC BY-SA 3.0
I'm trying to SEO optimize my blog, and I'm not sure which method is the best SEO practice. I seem to google conflicting results. Some say 1. is best because of days old, other says nowadays index.html isn't as important as it was.
If it's important, I'm running WordPress as blog software. Self-hosted.
I have the choice to have it:
https://www.example.com/post-title/index.htmlhttps://www.example.com/post-title.htmlhttps://www.example.com/post-title
已采纳解答
原帖链接 · Mike -- No longer here · CC BY-SA 3.0
Aim for friendly URLs.
Unless your blog talks about html code and you wanted to share links to examples of html code, I suggest trying to craft your URLs to exclude the extension.
So your blog URL could be (for example) something like this:
https://example.com/post-date/post-title/page-number
then you can have it map to this sample URL:
https://example.com/script.php?posttitle=title&postdate=date&pagenumber=number
If your server is apache based, then you can create an .htaccess file in the document root folder with the following contents:
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ /script.php?posttitle=$1&postdate=$2&pagenumber=$3
then the script will take in the contents before the first slash in the URL after the http:// as the posttitle value and the contents between the two single slashes as the postdate value and the contents after the final slash as the pagenumber value.
Depending on how your wordpress script handles parameters, you may need to change /script.php?posttitle=$1&postdate=$2&pagenumber=$3 to match the wordpress script name and load the parameters correctly.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
