To mod_rewrite or Not to mod_rewrite

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
DChapman submitted a new Article:

To mod_rewrite or Not to mod_rewrite

Mod_rewrite is all the rage in forum search engine optimization these days. For those who don't know what mod_rewrite is, the general idea is to take a dynamic url such as [noparse]http://www.theadminzone.com/forums/showthread.php?t=20341[/noparse] and "rewrite" it using mod_rewrite so it becomes [noparse]http://www.theadminzone.com/forums/does-google-hate-me-20341.html[/noparse]. Some companies are charging well over $100.00 for software that does this, so it MUST be a good thing to do, right? Not necessarily.

Mod_rewrite came about because at one time, search engines were unable to properly follow dynamic urls such as [noparse]http://www.theadminzone.com/forums/showthread.php?t=20341[/noparse]. If you utilized such url formatting, you were destined to be poorly indexed in the search engines. At this point in the internet era, it was a very good idea to utilize mod_rewrite. Your content wasn't being indexed, so why not? Since then, search engine technology has improved a great deal and they now have no problem with the vast majority of dynamic urls. Since search engines can now index the content of your forum even if you have dynamic urls, it is actually a BAD idea to utilize mod_rewrite. But why?

To properly implement mod_rewrite, you utilize a 301 redirect that redirects traffic from the old thread at [noparse]http://www.theadminzone.com/forums/showthread.php?t=20341[/noparse] to the new thread at [noparse]http://www.theadminzone.com/forums/does-google-hate-me-20341.html[/noparse]. It is amazing how many SEO hacks do NOT utilize this 301 redirect which is a VERY bad idea. However, rewriting your urls can hurt you even if your hack DOES utilize proper redirects because, contrary to widespread and popular belief, 301 redirects do NOT transfer inbound link benefits!

Google states in their information for webmasters:
If your old URLs redirect to your new site using HTTP 301 (permanent) redirects, our crawler will discover the new URLs. For more information about 301 HTTP redirects, please see http://www.ietf.org/rfc/rfc2616.txt.

Google listings are based in part on our ability to find you from links on other sites. [highlight]To preserve your rank and help our crawler find your new URL, you'll want to inform others who link to you of your change of address.[/highlight] To find a sampling of sites that link to yours, perform a link search by entering...

Read more about this article here...
 
Last edited by a moderator:

halfway

Aspirant
Joined
Mar 13, 2006
Messages
34
Another excellent article [zoints]dchapman and again I wish something as easy to understand as that had been around when I wanted to know about it all.

It's not even necessarily the highest ranking pages that come up top in Google searches and in some case the PR doesn't mean anything if the site has the required search phrase.

Another thing I noticed with Google recently is that what are essentially sub-domains but with their own TLD almost seem to get treated as new pages to a main domain. It gets PR without having any other inbound links, except from its sister site! Or was that the moving and mod_rewrites I did for certain pages taken from the other domain?
 

KeithMcL

Freelance Web Designer
Joined
Jan 12, 2004
Messages
5,728
Do search engines still see the old URL even if all links are written with mod_rewrite in mind?

For instance, since day 1 I have used mod_rewrite on one of my sites. Any links that are parsed through php code display the modified url. So instead of printing the url as www.mysite.com/category.php?category=2 it has always been displayed as www.mysite.com/category/budget-hosting/.

If the search engines can tell I'm using mod_rewrite, then I'm better off changing. Right? If not, then the only harm is the system resources it's using.
 

BamaStangGuy

Fanatic
Joined
Jan 8, 2005
Messages
3,215
KeithMcL said:
Do search engines still see the old URL even if all links are written with mod_rewrite in mind?

For instance, since day 1 I have used mod_rewrite on one of my sites. Any links that are parsed through php code display the modified url. So instead of printing the url as www.mysite.com/category.php?category=2 it has always been displayed as www.mysite.com/category/budget-hosting/.

If the search engines can tell I'm using mod_rewrite, then I'm better off changing. Right? If not, then the only harm is the system resources it's using.
You are correct. The search engines can not tell that you are using mod_rewrite.
 

KeithMcL

Freelance Web Designer
Joined
Jan 12, 2004
Messages
5,728
BamaStangGuy said:
You are correct. The search engines can not tell that you are using mod_rewrite.
In that case, I'm going to stick with mod_rewrite for the simple fact that the URLs are more user friendly.
 

DChapman

Devotee
Joined
May 20, 2004
Messages
2,880
KeithMcL said:
Do search engines still see the old URL even if all links are written with mod_rewrite in mind?

For instance, since day 1 I have used mod_rewrite on one of my sites. Any links that are parsed through php code display the modified url. So instead of printing the url as www.mysite.com/category.php?category=2 it has always been displayed as www.mysite.com/category/budget-hosting/.
Excellent point. If you have been using mod_rewrite or others plan to use mod_rewrite from day one, then there's really no major issue. I should have mentioned that in my article, thank you for calling me on it. :)
 

Jesse

Participant
Joined
Mar 31, 2006
Messages
62
KeithMcL said:
In that case, I'm going to stick with mod_rewrite for the simple fact that the URLs are more user friendly.

I've actually never really cared whether or not a board used it or not. Now that I look, none of the forums I post on use it
 

KeithMcL

Freelance Web Designer
Joined
Jan 12, 2004
Messages
5,728
Jesse said:
I've actually never really cared whether or not a board used it or not. Now that I look, none of the forums I post on use it
I don't have my forum setup like this (I used to), but I think it's easier for people to remember the likes of www.mysite.com/category/budget-hosting/ than www.mysite.com/category.php?category=5. Trying to remember each category number would be difficult. Why not make it as easy as possible? There's no harm in that :)
 

Jesse

Participant
Joined
Mar 31, 2006
Messages
62
no, it may eventually help people, but I don't think it will make or break you
 

Wayne Luke

Tazmanian
Joined
Jan 6, 2004
Messages
5,791
It should be added that you can do similar things under IIS using a tool called "ISAPI Rewrite". This tool is available in both a free and commercial version and was written to mimic mod_rewrite functionality in an IIS environment. You can find it here:
http://www.isapirewrite.com/
 

Jim McClain

Senior Citizen
Joined
Jan 31, 2006
Messages
2,006
[Zoints]DChapman said:
... did you know that using mod_rewrite WILL increase server load and page load times?
It is my belief that it isn't mod_rewrite that will have a performance hit, it is having any .htaccess file at all. I was looking for clarification on another issue having to do with an .htaccess file just recently and ran across this:
Apache Tutorial said:
When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested.
Read the full tutorial HERE.

I thought yours was an interesting article, but my current project, www.TheFloorPro.com, is still less than 2 months old and I feel re-writing the URLs is going to be a help for my niche site. I have other sites that are older and have never ranked well in the search engines. It could be that using rewrite, along with other tools, will improve those sites over all. Using mod_rewrite is just one more tool in the box that is available for site building and improving. Like any other tool, used wrong it can do more harm than good. Sometimes the tool just doesn't do what is expected, but I am happy to have it in the box.

Thank you for sharing your knowledge and experience with us.
 

Jim McClain

Senior Citizen
Joined
Jan 31, 2006
Messages
2,006
Hello EGS,

Seems like a little gratuitous linking there. I was a little confused when I followed one of the links because I am a member of webmaster-talk.com -- yours is webmasters-talk. Anyway, this is a TAZ discussion about mod_rewrite, not a discussion that should be diverted to your website.

But since you suckered me into going...
You said said:
I have yet to ever see it increase server load on my dedicated server. IMO, that's just a rumor. I got about 30 domains with about 54 lines in the domain.com/.htaccess file and have yet to ever see it effect the server. The only effect I've ever got is getting GoogleBombed (Google chomping away at the static URLs so much that the server almost crashes or does crash!!!). Don't panic. This is why you have static URLs, to help search engines crawl your site.

If you ever see high server loads or a slow server, try optimizing Apache.
I believe that rumor you mentioned came directly from the horses mouth: Apache.org. And many, if not most webmasters do not have access to their server configuration files. We have to work with our hosts and the tools we have, like the .htaccess file, to manage our sites and the load placed on our little corner of the server.

R'gards,
 

King Justice

Enthusiast
Joined
Jan 14, 2006
Messages
100
eJM said:
Hello EGS,

Seems like a little gratuitous linking there. I was a little confused when I followed one of the links because I am a member of webmaster-talk.com -- yours is webmasters-talk. Anyway, this is a TAZ discussion about mod_rewrite, not a discussion that should be diverted to your website.

But since you suckered me into going...

I believe that rumor you mentioned came directly from the horses mouth: Apache.org. And many, if not most webmasters do not have access to their server configuration files. We have to work with our hosts and the tools we have, like the .htaccess file, to manage our sites and the load placed on our little corner of the server.

R'gards,
That quote isn't what I said, it's what a friend of mine said as it's his article and he allowed me to put it on my forum for my visitors. :)

Nevertheless if you don't have access to the configuration files, you can always contact your host.
 

BamaStangGuy

Fanatic
Joined
Jan 8, 2005
Messages
3,215
No one here is saying that vBulletin pages do not get indexed stock. Why people continue to act like that is what people are saying is beyond me. You mod_rewrite to get keywords into your urls which may or may not help in search engine rankings. In my experience it has helped me.
 

TheMaTrIx

Adherent
Joined
Jul 24, 2004
Messages
292
Rewriten URLs are a miniscule factor in search engine ratings and imho their only real purpouse is giving users a nice URL.

Whats important are the following:

META tags, both meta title, meta description and meta keywords should be acurate for each and every page your site generates.

Title tags, same as meta title tags, make them unique for each page.

Correct use of <H> tags. Why? It gets higher priority in when the search indexer decides what your page is about then the general text on that page.

Make sure that thread and article titles are SEF, think "what would someone type into google when hes looking for this type of information"

If you run a forum and a thread starter talks about Windows XP SP2, normaly "Windows XP SP2" should be at the top of every reply in that thread, this is done so that the topic title is a predominant textblot in this page, that returns often.

Keywords Keywords Keywords.
If a page is about say "pimping out a BMW X5", make sure that "BMW X5" is mentioned on the page several times, make sure that 'pimping, tuning, modding, ..." are represented on the page aswell. If you write a 2000 word article about pimping a X5 and only mention that 1ce in that page and for the rest the text is drivel about how it looks, the speakers you built in, the pink velvet rugs and stuff like that, the search engines don't know that the article is about "pimping out a BMW X5".

When you are writing an article, think "what search phrase would someone use in google to find this kind of information" when you think of the answer to that question, incorporate that search phrase in your text and also incorperate the words from that search phrase in your text.
 

comperr

Master Admin
Joined
Aug 11, 2006
Messages
1,124
What's funny is that in osCommerce there is a beta option that is called "search engine safe" URLs. This is a 'mod_rewrite' hack.
 

SaN-DeeP

TechArena.IN
Joined
Jun 30, 2004
Messages
4,259
does mod_rewrite using third party tools for vbulletin software script increases server loads ?
 
Top