This topic is locked

Mod Rewrite for SEO Friendly Pages...

9/26/2007 8:05:11 PM
PHPRunner Tips and Tricks
powersitedesign author

I created a Real Estate solution for a client a while back in php and it has worked well for them but once the site launched we noticed that it wasn't getting crawled by the search engines as well as we would have liked for it to so I did a little research. I knew that typically data called in from a database dynamically presented a problem when it came to getting the best SEO performance. I asked a few developers this past year at HostingCon about this and they suggested I look into Mod Rewrite in apache and see if that wouldn't help out. I checked it out and so far the results have been phenomenal for the client. Here's what I did in case any of you run into a smilar situation. I first created an .htaccess file to redirect to a "home page", in this case it's called index2.php. Next I did a rewrite for the dynamically generated pages. The .htaccess file looks like this:

Redirect permanent /index.php http://www.greersferryrealestatecenter.com/index2.php
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^index2.php prime-listings/index_view.php?editid1=1

RewriteRule ^prime-listings/lakefront_homes.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakefront+Homes&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakefront_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakefront+Lots&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakeview_homes.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakeview+Homes&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakeview_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakeview+Lots&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/river_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=River&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/residential_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Residential&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/residential_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Residential+Lots&SearchOption=Equals&SearchField=

RewriteRule ^prime-listings/commercial_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Commercial&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/farm_land.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=acreage&SearchOption=Contains&SearchField=


So now for example, instead of using http://www.greersferryrealestatecenter.com...earchField=type as a link, I just use this: http://www.greersferryrealestatecenter.com..._properties.php. This is apparently more favorable to the search engines.
Just wanted to pass this tidbit along...

W
wwwguru 9/26/2007

this is an excelent asset to this forum

N
nicolagrimshaw 9/17/2008

Slightly belated (but just what I am looking for at the moment!)... I agree this is an excellent tip. Is there any way of extending this to the view pages?
For example http://www.greersferryrealestatecenter.com...php?editid1=133 could be rewritten to become http://www.greersferryrealestatecenter.com...t_home_10173470 or similar?
I have also managed to make my pages more seo friendly by changing the titles to be more descriptive (although I keep losing them everytime I have to reset the page or query). For example

<TITLE>{$show_[i]XXXX[/i]}</TITLE>


I'm also planning to create a field in the database for other metatags and include them by using {$show_XXXX}
Hope this makes sense?

N
nicolagrimshaw 9/17/2008

Sorry I tried to make it easier for an idiot like me to understand but managed to make it more complicated by using italics

<TITLE>{$show_XXXX}</TITLE>


(where XXX is the name of the reuired field)

powersitedesign author 1/6/2009

[quote name='don'tknowwhatI'mdoing' post='33141' date=Sep 17 2008, 03:13 AM]Sorry I tried to make it easier for an idiot like me to understand but managed to make it more complicated by using italics
<!--c1-->[codebox]

<HEAD>

<TITLE>Rustic Cabin on Greers Ferry Lake</TITLE>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<LINK href="http://www.greersferryrealestatecenter.com/powersite_cms/include/style.css"; type=text/css rel=stylesheet>

<META content="MSHTML 6.00.6000.16609" name=GENERATOR>

</HEAD>

<H1>Rustic Cabin on Greers Ferry Lake</H1>

[/codebox]

S
skbrasil 5/6/2016



I created a Real Estate solution for a client a while back in php and it has worked well for them but once the site launched we noticed that it wasn't getting crawled by the search engines as well as we would have liked for it to so I did a little research. I knew that typically data called in from a database dynamically presented a problem when it came to getting the best SEO performance. I asked a few developers this past year at HostingCon about this and they suggested I look into Mod Rewrite in apache and see if that wouldn't help out. I checked it out and so far the results have been phenomenal for the client. Here's what I did in case any of you run into a smilar situation. I first created an .htaccess file to redirect to a "home page", in this case it's called index2.php. Next I did a rewrite for the dynamically generated pages. The .htaccess file looks like this:

Redirect permanent /index.php http://www.greersferryrealestatecenter.com/index2.php
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^index2.php prime-listings/index_view.php?editid1=1

RewriteRule ^prime-listings/lakefront_homes.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakefront+Homes&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakefront_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakefront+Lots&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakeview_homes.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakeview+Homes&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/lakeview_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Lakeview+Lots&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/river_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=River&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/residential_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Residential&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/residential_lots.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Residential+Lots&SearchOption=Equals&SearchField=

RewriteRule ^prime-listings/commercial_properties.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=Commercial&SearchOption=Equals&SearchField=type

RewriteRule ^prime-listings/farm_land.php prime-listings/prime_listings_list.php?a=search&value=1&SearchFor=acreage&SearchOption=Contains&SearchField=


So now for example, instead of using http://www.greersferryrealestatecenter.com...earchField=type as a link, I just use this: http://www.greersferryrealestatecenter.com..._properties.php. This is apparently more favorable to the search engines.
Just wanted to pass this tidbit along...


I would like to help, desenvouvi an online manual guide and I am unable to do the rewrite of the page
example
www.manuisonline.com
this is the model that tried to implement:
RewriteEngine on
ErrorDocument 404 /index.php
RewriteRule ^ search /(.)/$ manual_list.php? Qs = $ 1

RewriteRule ^ search / (.
) / ([0-9] +) /? $ Manual_list.php? Goto = $ 2
RewriteRule ^ / manual ([0-9] +) /? $ Manual_view.php? Editid1 = $ 1

RewriteRule ^ / manual? $ Manual_view.php
RewriteBase /

RewriteCond% {REQUEST_FILENAME}! -f

RewriteCond% {REQUEST_FILENAME}! -d