Page 1 of 1

SE-Friendly URL's with PHP... not mod_rewrite??

Posted: Fri Sep 22, 2006 6:26 pm
by seodevhead
Hey guys... I have some scripts that I am interested in doing some SE-friendly URL'ing to (ie. mod_rewrite). After searching for some tutorials on how to do mod_rewrite... I came across this tutorial on how to achieve the same thing but instead of using mod_rewrite engine... it uses PHP instead:

http://www.tutorio.com/tutorial/php-alt ... endly-urls

At the end of the tutorial, they gave some comparison opinions between Mod_Rewrite and the PHP method:

Comparison with mod_rewrite

Flexibility:
Mod_rewrite is much more flexible than the php method, but whats fexible to some is complicated to others

SEO:
I think that both are pretty much equal. The only problem with the php method is the urls sometimes become very long. Still this is more of a user friendliesness problem than a SEO problem

Sever Resources:
This is where the php method really shines, specially for larger sites. Because doing mod_rewrite on sites with a lot of pages takes up a large amount of resources. This is also the reason why tutorio.com uses the php method for our urls.

Is this true? Have any of you guys used this method? I have quite a bit of DB apps that are going to have quite a many (thousands) of pages (much like these forums) and am considering server resources (eventhough I have a dedicated luckily). So any advice on this matter is greatly appreciated. Thanks for your replies.

Posted: Fri Sep 22, 2006 6:44 pm
by s.dot
I don't see any problems with mod rewrites. Here's how I do it.

Sample Rewrite Rule

Code: Select all

RewriteEngine On

RewriteRule ^/user/blog/([0-9]+)_.+.html$ /blog.php?blogid=$1
In this example, it will capture the ID of any blog, along with any title, and redirect to the blog. Some sample URLs would look like this.

/user/blog/42_my-blog-about-something.html
/user/blog/33883_my-other-blog-about-something-else.html
/user/blog/233_some-other-blog

Now, this only uses one mod rewrite rule, but is unlimited in the number of blogs it could be redirected to. I don't see any heavy resource usage in that. I actually use this on some heavily accessed applications, and having no resource problems.