1

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:

  1. https://www.example.com/post-title/index.html
  2. https://www.example.com/post-title.html
  3. https://www.example.com/post-title
  • index.html is not a good idea IMO. post-title.html is optional if you are running wordpress so I guess do which ever you prefer. This could probably be flagged as highly opinionated – William Feb 15 '16 at 18:41
  • You are running WordPress but ask about static pages? – unor Feb 15 '16 at 18:53
  • I personally prefer to see www.example.com/post-title/. You can use the URI (path) for heavy semantic clues found here: webmasters.stackexchange.com/questions/74633/… FYI – closetnoc Feb 15 '16 at 19:26
5

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.

  • I personally believe that semantic clues in the URI (path) are stronger than the domain name and the file name (what you are calling friendly URLs). The rest of your answer I assume has to do with WP? I have no idea. – closetnoc Feb 15 '16 at 19:24
  • My answer describes how one can create a friendly URL for their website just in case the OP decides to go for it. – Mike Feb 15 '16 at 19:26
  • I recognized that, I just do not know WP and whether it applies to a WP site and if there are options to make friendly URLs happen. I have no clue. Instead, I chose to trust you completely! After all, the rest seems right to me. Cheers!! – closetnoc Feb 15 '16 at 19:29
  • I can do permalinks via example.com/post-title . Seems to be the consensus to go with that. No .html. – Grumpy ol' Bear Feb 15 '16 at 19:37
2

The index.html in /post-title/index.html doesn’t appear to be relevant information, neither for bots nor for human visitors.

It’s a backend/implementation detail (like /index.php/, /wordpress/, .jsp, etc.), and URLs are better off without them. You could even argue that the .html extension belongs to this category.

  • I completely agree with one caveat. Sure index.html does not say anything, but how-to-tune-a-car.html does. I prefer putting all the semantic signals into the URI (path) without a page/file, however, semantic clues in the file name can help too. – closetnoc Feb 15 '16 at 19:22
2

If I was there, then I will choose these URL's, depend on my server configuration.

https://www.example.com/post-title
https://www.example.com/post-title/

As you can see, the only different is, slash at the end of URL. If you are running Wordpress in nginx server, then you can easily serve your content without slash at the end of URL, just like stackexchange serve.

Technically first one is consider as file In UNIX system, while second one is directory. but choose whatever you like it. Just don't forgot to redirect between them if someone forgot or add slash at the end of URL.

Now, why I said, these URL's are good?

Because it is user friendly(No worry about how people link to you) + You can change your language/platform any time, may be in future Java/HTML/PHP/GO overtake to other language, then may be you will switch to other CMS, which is easiest for you.

So in the future(My assumption) all CMS and blogging platform allowed to use permalink without any extension name, so use these type of URL's, if you depend on new technology, because it does not effect in SEO, if you switch to another one. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.