Mobile app version of vmapp.org
Login or Join
Sent6035632

: SEO - which URL's are the best? I'm using .htaccess with RewriteRule to create SEO-friendly URL's. However, I have a few questions about this: First of all, I noticed many websites end

@Sent6035632

Posted in: #Htaccess #Php #Seo #Url

I'm using .htaccess with RewriteRule to create SEO-friendly URL's. However, I have a few questions about this:


First of all, I noticed many websites end their URL's with .html (or another extension). For example: www.example.com/news/564/seo-improvements.html Does ending an URL with an extension have an impact on SEO?
Which URL is the best (again, for SEO):
www.example.com/news/564/seo-improvements.html http://www.example.com/news/564-seo-improvements.html

I've noticed both notations are often being used.
On many websites, I notice you can alter the text part of the URL, which is followed by a redirect. For example:
www.example.com/news/564/seo-improvements.html <-- original URL www.example.com/news/564/sefkdjfjdfkdjfk.html <-- altered URL, will redirect to the first one

How can such a redirect be done?


Thanks

EDIT:
When creating this thread, I got a warning this question may be subjective - is it? Isn't there a "correct" answer on these questions?

10.06% popularity Vote Up Vote Down


Login to follow query

More posts by @Sent6035632

5 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

My general approach to SEO is to setup my site in the way that's makes the most sense for my visitors first, but also works for ranking well on search engines. When it comes to URLs and search engines, they'll be able to index your site as long as you have a unique URL.

To answer your first question, search engines may not care if you end your pages with an extension like .html, but I think it makes it easier for visitors to know a link is for a webpage (and not a directory or file) if it ends in .html. Plus, Matt Cutts suggested keeping file extensions such as .html for this reason (Matt Cutts interview from GoogleWebmaster YouTube Channel). He's not saying there's a penalty for not using extensions, but given how few "real" answers are released from search engines around SEO I prefer to follow his advice.

For question two, I don't see any SEO difference in those URLs. Go with the one you think looks best.

Question 3, this is can be done with a simple 301 redirect.

10% popularity Vote Up Vote Down


 

@Becky754

1) you can trim .html

2) second case maybe better cause / separes phrase in path, but we speak about microscopic factor

3) if you use redirect 301 near 100% of rank goes to destination page

10% popularity Vote Up Vote Down


 

@Nimeshi995

The golden rule is that URIs should not change, content should.


In terms of SEO, there isn't much difference, for now at least. The problem with extensions on URIs is that after a while, they become outdated. This is commonly seen with sites that have URIs ending with .cgi, when the backend probably stopped using CGI a long time ago. The same goes for HTML. It's the current standard now, but who's to say that it still will be in years to come. What about XHTML...?
Again, as far as search engines are concerned, there should be no difference. It's often a good idea to have hackable URIs. Given /images/2010/summer, it's handy if the user can hack the URI down to /images/2010 and still get a valid page of images from 2010. Or /images/ and get a valid pages of images. Your example is slightly different, in that 564 is just a unique ID (probably in a database) for a given item. The bit that follows is just a handy human-readable part. Hopefully, hacking it down to /news/564 would return the same thing - perhaps redirecting to /news/564/seo-improvements in the process.
See 2. The back-end app probably doesn't care about the bit after 564.


For more information, see:

Cool URIs don't change
Cool URIs for the Semantic Web

10% popularity Vote Up Vote Down


 

@Sims2060225

No difference from SEO perspective. But may be an issue for some people's minds: "Pfew, stone-age html"
No difference at all.
This approach is also used on this site - try for yourself. The important part in URL is an ID which can uniquely identify one URL from another (take this site for example: there can be more than one question with the same title/slug but IDs will be different).

The logic behind is simple -- check DB is slug matches one on record. If not -- issue 301 redirect to a proper URL.

10% popularity Vote Up Vote Down


 

@Murray432

3) Concerning the redirect

In www.example.com/news/564/seo-improvements.html I assume that /seo-improvements.html is just "sugar". All important information is in the www.example.com/news/564 part (news and 564).

Therefore, if the news entity with id 564 is found, but the URL does not match the expected slug, one can easily issue a redirect with the correct slug.

(I'm not sure that I applaud this strategy, though.)



As for points 1) and 2), you may find Underscores are now word separators, proclaims Google worth a read. I don't know whether this is (or; was ever) true!:


Matt stated that the number of slashes in your URL (i.e. the number of directories deep your page is) isn't a factor in your Google rankings.


And


According to Matt, the file extension in your URL won't affect your rankings.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme