4
Contributors
6
Replies
25
Views
3 Years
Discussion Span
Last Post by Dani
0

What do you mean by "internal links" vs "external links"? All links on your site and off your site should use the rewritten links. There should be no way for a website visitor to know what the real path to the file is, no hyperlinks anywhere pointing to it, etc.

Many years ago, URLs were rewritten because search engine bots had a hard time navigating dynamic sites that had multiple query strings. They would end up in loops recrawling the same page a billion ways with an infinite number of query string parameters. URLs were rewritten to "fake" the behavior of static (non-dynamic) pages. Nowadays, bots have improved and don't really have such a hard time anymore. URLs are rewritten for usability's sake. For example, the path to this current page is:

/web-development/php/threads/462191/url-rewrite-with-.htaccess-what-about-internal-links

From a usability perspective, that URI tells you a lot about the page, and helps define some breadcrumb navigation.

You can of coure rewrite URLs in directories, multiple directories, etc. You can use regular expressions to manipulate anything to look like anything else, pretty much.

0

Dani - thanks - yes, by internal I meant links within the site pointing to other pages within the site.

So, are there any "cons" to using this approach? Doesn't sound like it.

0

There could only be a single con
:where a folder name and extensionless filename are the same:
likeliehood, zero, non existent, would only happen to someone not checking design.

0

Thanks almostbob - I think I'll continue using it - seems like it's a good thing.

0

So, are there any "cons" to using this approach? Doesn't sound like it.

I think the benefits greatly outway any cons you may come up with. Of course, the URL rewriting introduces the risk of making mistakes with your rules, but that can be mitigated by following a testing process prior to publishing new rules.

Aside from search engine optimization, the clean URLs make your site that much more user friendly.

Another benefit, if you ever have to rearrange your structure, you can write rules to redirect users (and spiders) to the new page while sending back the appropriate HTTP responses.

Here is an example of a set of rules where I used both redirects and rewrites:

Old URL: http://www.anitkb.com/2010/10/how-to-pass-parameters-to-vbscript.html

New URL: http://www.itgeared.com/articles/1075-how-to-pass-parameters-to-vbscript/

Notice that the domain changed as well as the path in the URL. Both point to the same new location now.

Edited by JorgeM

0

Ah, yes, if this isn't a new site, be sure to use 301 redirects to redirect users at the old URI to the new URI.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.