Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-20-2008, 12:28 PM
mryang's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: uk
Posts: 127
mryang RepRank 1
Default Rewrite for SEO purposes - php to html

Hi,

Hope someone can help me achieve the following.

I have my dynamically generated pages using php - for example:

dvd-and-media.com/cartridges_purchase.php?Model=HP+Photo+Smart+P1115

And then I have written a piece of code to get the following, basically it replaces the 'cartridges_purchase.php?Model=' with 'Inkjet-Cartridges-' then it replaces the '+' signs in the rest of the URL with '-' and adds a html extension - so I then end up with the following URL

dvd-and-media.com/Inkjet-Cartridges-HP-Photo-Smart-P1115.html


However what I need to do is have google find the .html pages instead of the php ones and serve up the html ones when the users click though to my ink products.

I presume I need some sort of mod rewrite and some adjustment to my robots file - help please!
__________________
http://www.dvd-and-media.com/ Largest suppliers of DVD cases in the UK
http://www.talkangling.co.uk/ Busiest fishing tackle and angling chat site in the UK
Reply With Quote
  #2 (permalink)  
Old 08-20-2008, 01:42 PM
ronniethedodger's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Central US
Posts: 1,581
ronniethedodger RepRank 0
Default Re: Rewrite for SEO purposes - php to html

I don't think you will need any robots.txt file adjustments.

One thing you will need in your .htaccess file is a directive to process .html pages as PHP.

Code:
AddType application/x-httpd-php .html .htm
or

Code:
AddHandler application/x-php .html .htm
I always have problems with one not working, but the other will. Try them both.

As for the pages themselves, I have seen one method that works without any need for nasty mod rewriting. You will still need a Rewrite rule in your .htaccess -- I am not sure how the rewrite rule is constructed, but it is a simple RegExp. Sorry.

All you need is one php script, without the .php extension. You will add that page to your .htaccess AddType php handler too. Lets call the file 'products'

All the products script does is process the rest of the url following afterward. The script file is in your root domain (not a sub-directory, but looks like a directory in the Url)

Code:
http://domain.com/products/ink-jet-ribbons-and-printers.html

Last edited by ronniethedodger : 08-20-2008 at 02:20 PM.
Reply With Quote
  #3 (permalink)  
Old 08-20-2008, 03:27 PM
incrediblehelp's Avatar
Moderator
WebProWorld Moderator
 

Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,703
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default Re: Rewrite for SEO purposes - php to html

Why in the world do you wan to change the extensions of the pages? They dont matter at all as far as SEO is concerned.
Reply With Quote
  #4 (permalink)  
Old 08-20-2008, 06:36 PM
WebProWorld New Member
 

Join Date: Aug 2008
Posts: 19
jasbloger RepRank 0
Default Re: Rewrite for SEO purposes - php to html

have u seen the google crawler code? why are u so sure about this?
__________________
expired domains database - browse old domains by back links, delicious bookmarks, google pagerank and ... . This database is free and don't require any member account.
Reply With Quote
  #5 (permalink)  
Old 08-20-2008, 08:01 PM
WebProWorld Pro
 

Join Date: Oct 2003
Location: Phoenix, AZ
Posts: 183
chowell RepRank 1
Default Re: Rewrite for SEO purposes - php to html

It sounds like you just need to setup the Mod_rewrite rules using .htaccess. Unfortunately, you'll need to use Regular Expressions to code the actual rewrites and this is Greek to me.

Be sure that in the rewrite directives that the dynamic URLs are 301'd to the .html versions and Google will index the .html pages without any problem.
Reply With Quote
  #6 (permalink)  
Old 08-21-2008, 11:01 AM
mryang's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: uk
Posts: 127
mryang RepRank 1
Default Re: Rewrite for SEO purposes - php to html

Incredible, I am not just changing the extensions of the pages I am rewriting the name of the page so that it is product specific.

How do I write a rule to 301 from the dynamtic page to the static ones bearing in mind I am changing the characters and replacing bits and bobs.. help please.
__________________
http://www.dvd-and-media.com/ Largest suppliers of DVD cases in the UK
http://www.talkangling.co.uk/ Busiest fishing tackle and angling chat site in the UK
Reply With Quote
  #7 (permalink)  
Old 08-21-2008, 07:13 PM
WebProWorld Pro
 

Join Date: Oct 2003
Location: Phoenix, AZ
Posts: 183
chowell RepRank 1
Default Re: Rewrite for SEO purposes - php to html

Here's a good resource: 301 Redirect - 301 Permanent Redirect by Brian V. Bonini

Basically, after you create your Regular Expression to rewrite the dynamic URL as a static one (w/ the keywords in it), you append [R=301,L] to the end of it.
Reply With Quote
  #8 (permalink)  
Old 08-22-2008, 07:32 PM
ronniethedodger's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Central US
Posts: 1,581
ronniethedodger RepRank 0
Default Re: Rewrite for SEO purposes - php to html

Quote:
Originally Posted by jasbloger View Post
have u seen the google crawler code? why are u so sure about this?
IncredibleHelp is correct. Its does not matter what the extension of the page is for it to rank. Has no bearing, heck I have seen pages without extensions ranking well.

You do not need to know the 'google crawler code to prove this theory. Just do a search and glance through the different filetypes that come up in the results. You might be surprised.
Reply With Quote
  #9 (permalink)  
Old 08-23-2008, 10:50 AM
WebProWorld New Member
 

Join Date: Aug 2008
Posts: 19
jasbloger RepRank 0
Default Re: Rewrite for SEO purposes - php to html

there are hundreds things that matter for seo and there are no way to be sure of anything. This that google search for system, don't show system.com in first 100 results do not prove that having keyword.com domain doesnt help etc.
__________________
expired domains database - browse old domains by back links, delicious bookmarks, google pagerank and ... . This database is free and don't require any member account.
Reply With Quote
  #10 (permalink)  
Old 08-24-2008, 03:01 AM
southplatte's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Colorado
Posts: 381
southplatte RepRank 1
Default Re: Rewrite for SEO purposes - php to html

To me it sounds as though he is trying to get rid of the URL parameters to clean it up for SEO purposes, rather than changing the names just to change them for the SEO aspect.

It is similar to wordpress - you can have it setup site.com/posts/post-title-goes-here instead of site.com/page.php?postid=184&this&that

And that is controlled use ModRewrite with apache if you are on a linux based box, and I have not a clue what the windows equivalent is for a url rewrite.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum


Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect old url for search engine purposes. zapiy IT Discussion Forum 4 04-22-2008 12:25 PM
Just how useful are Social Bookmark Sites for SEO Purposes? gky45 Search Engine Optimization Forum 42 07-20-2007 02:48 PM
URL Rewrite? ID=1.html or .html?ID=1 will it matter? TransferTown Google Discussion Forum 3 12-29-2006 05:17 PM
rss + blog for seo purposes - what's the big deal? ymid Search Engine Optimization Forum 13 06-30-2006 03:55 PM
For SEO purposes, is there a difference between ..... tiger1 Search Engine Optimization Forum 2 07-13-2004 12:26 PM


Search Engine Optimization by vBSEO 3.2.0