Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 11-06-2008, 12:02 AM   #1
Senior Warrior Member
War Room Member
 
Alan Petersen's Avatar
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 3,386
Blog Entries: 11
Thanks: 723
Thanked 778 Times in 494 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Replacing ?php stuff from URL with SEO friendly link

Hello,

I had a custom CMS done for me at RAC. When I setup a product page the URL is displayed like this:

http://www.mydomain.com/product_detail.php?id=84

Is there a way I can have those links displayed as user friendly URL like

http://www.mydomain.com/product-keywords

It's not a feature built into the CSM (I thought about it after the fact) and I can't get a hold of the developer. Is there anything I can do? Perhaps in the .htaccess?

I recall there was a script or something that would allow this to be done for Joomla. Any suggestions?

Thanks.

Alan Petersen is offline   Reply With Quote
Old 11-06-2008, 12:11 AM   #2
Rockin' Warrior
 
Farhan Ahmad's Avatar
 
Join Date: Oct 2008
Location: Malaysia
Posts: 93
Thanks: 33
Thanked 8 Times in 6 Posts
Default Re: Replacing ?php stuff from URL with SEO friendly link

what cms are you using? Joomla? or custom made?

if custom, you can use modrewrite for this.

this forum will help you a lot http://forum.modrewrite.com
Farhan Ahmad is offline   Reply With Quote
Old 11-06-2008, 12:22 AM   #3
Senior Warrior Member
War Room Member
 
Alan Petersen's Avatar
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 3,386
Blog Entries: 11
Thanks: 723
Thanked 778 Times in 494 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Re: Replacing ?php stuff from URL with SEO friendly link

It's custom. Checking that forum now. Thanks.

Alan Petersen is offline   Reply With Quote
Old 11-06-2008, 11:17 AM   #4
Programmer / Writer
War Room Member
 
Join Date: Nov 2008
Location: SC, USA
Posts: 307
Thanks: 13
Thanked 205 Times in 54 Posts
Default Re: Replacing ?php stuff from URL with SEO friendly link

.htaccess is definitely the way to go with this
Writing a modrewrite command for htaccess to handle something like that will be fairly simple. You will find the hard part is going to be modifying the script to reflect those changes. Anywhere that url structure is used will need to be changed to reflect the new structure.

I've done a number of projects involving this and your best option is to have some kind of unique identifier used as the url. When you have lots of products that may have same/similar names, this can become a problem. The easiest thing to do is make a url that involves the product title as well as a database id # that can be used to identify it (ie, product_detail.php?id=84 might become Product_Name_84.html). Your modrewrite command would then look for the .html calls and send along the numeric value at the end as the id # for product_detail.php.
Hope that made some kind of sense and will provide some help.
Ryan
phpnetpro is offline   Reply With Quote
Old 11-06-2008, 11:48 AM   #5
Senior Warrior Member
War Room Member
 
Alan Petersen's Avatar
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 3,386
Blog Entries: 11
Thanks: 723
Thanked 778 Times in 494 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Re: Replacing ?php stuff from URL with SEO friendly link

Thanks for the tips. I've been kicking the mod_rewrite around. What I did was create a folder on www called product_name.

Then I added this code to my .htaccess file:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule product_detail/(.*)/(.*)/$ /product_detail.php?$1=$2
So the Rewritten URL would be:

http://www.domain.com/product_detail/id/85/

Instead of:

http://www.domain.com/product_detail.php?id=85

And it works but none of my images file show up and when you click on home I get a 404. I'll probably put this out for bid on RAC so I don't waste a lot more time on this.

Thanks for the info!

P.S. Any ideas what is a fair amount to pay for this? I would assume for a coder it would be a pretty simple thing to setup this for me.

Alan Petersen is offline   Reply With Quote
Old 11-06-2008, 12:29 PM   #6
Web Developer
 
wayfarer's Avatar
 
Join Date: Nov 2008
Location: Asheville, NC USA
Posts: 420
Thanks: 18
Thanked 57 Times in 51 Posts
Social Networking View Member's Twitter Profile 
Default Re: Replacing ?php stuff from URL with SEO friendly link

http://www.domain.com/product_detail/id/85/

is not more SEO friendly than

http://www.domain.com/product_detail.php?id=85

IMHO

Probably the reason you're getting a 404 when you click on home, and the reason the images don't show up, is that, when you have the URL rewritten like that, the browser considers you to be up 2 directory levels, and so, if the link paths (including the one for the images), are not relative to the root (/path/to/image.jpg) - note the slash at the beginning, and are relative to the page instead (path/to/image.jpg), you will get a 404 or missing image because it is looking in the wrong place.

Wayfarer | join me on StoryBlorg
wayfarer is offline   Reply With Quote
Old 11-06-2008, 05:34 PM   #7
Active Warrior
 
lumpy burgertushie's Avatar
 
Join Date: Nov 2008
Posts: 81
Thanks: 0
Thanked 8 Times in 6 Posts
Default Re: Replacing ?php stuff from URL with SEO friendly link

I agree, the search engines have absolutely no problem with dynamic urls.

Think about all the phpbb etc. bulletin boards out there that have every single post indexed in google.


robert
lumpy burgertushie is offline   Reply With Quote
Old 11-06-2008, 05:50 PM   #8
Senior Warrior Member
War Room Member
 
Alan Petersen's Avatar
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 3,386
Blog Entries: 11
Thanks: 723
Thanked 778 Times in 494 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Re: Replacing ?php stuff from URL with SEO friendly link

Quote:
Originally Posted by lumpy burgertushie View Post
I agree, the search engines have absolutely no problem with dynamic urls.

Think about all the phpbb etc. bulletin boards out there that have every single post indexed in google.


robert
That contradicts what I've read in the past. I'll have to do some more research on that. It's not as much as to just get indexed but rank well for certain long tail keywords. If I'm trying to rank for "weight loss" but the URL is /product_detail.php?id=85 and "diet pills" URL is /product_detail.php?id=86 I might rank well for product_detail not "weight loss" and "diet pills". Thanks.

Alan Petersen is offline   Reply With Quote
Old 11-06-2008, 07:31 PM   #9
Web Developer
 
wayfarer's Avatar
 
Join Date: Nov 2008
Location: Asheville, NC USA
Posts: 420
Thanks: 18
Thanked 57 Times in 51 Posts
Social Networking View Member's Twitter Profile 
Default Re: Replacing ?php stuff from URL with SEO friendly link

Google only looks at the URL if there is nothing in the title, and no headers. Although there is plenty of information that says you need to optimize the name of your page, I think there is more myth than truth in the idea, and the general consensus among SEO professionals that I communicate with, is that it matters very little.

Way back in the 1990's it was hard for search engines to read dynamic URLs that were really long, and they would stop parsing them after a certain length, which is where this myth came from.

Even if the name of a URL has a measure of weight, the way you rewrote it, it wouldn't help, since you didn't rewrite it to be semantically meaningful:
The main reason to do rewriting is to make the web addresses more user-friendly, and easier to type.

Basically, what is happening in the query product_detail.php?id=85 is that the program is finding the product on row 85 of your products table, and using all the information there to build the page. Another thing you could do, is query the table using the name of the product, then pass that name in a variable, and then rewrite it as a friendly URL. That does introduce some security issues, but they are easy enough to deal with. The problem with this approach is, that it won't work if there are two products that are named the exact same thing. There are a couple ways to deal with this, such as including the product number in the query string, but I doubt it is really worth the effort.

Wayfarer | join me on StoryBlorg
wayfarer is offline   Reply With Quote
Old 11-06-2008, 09:28 PM   #10
Senior Warrior Member
War Room Member
 
Alan Petersen's Avatar
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 3,386
Blog Entries: 11
Thanks: 723
Thanked 778 Times in 494 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Default Re: Replacing ?php stuff from URL with SEO friendly link

Good article about dynamic vs. static urls...

SEOmoz | Dynamic URLs vs. Static URLs - The Best Practice for SEO is Still Clear

This is really an entire different subject since I just need to know how to make my dynamic URL's static but it's a good point to debate when it comes to SEO.

Alan Petersen is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
friendly, link, php, replacing, seo, stuff, url

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 04:05 PM.