Need a little help with RewriteRule & SEO

I switched my site platform over to dolphin almost a year ago now, and in that time frame I was able to experiment with SEO & what search engines find easiest on D7 sites. Using a sitemap generator was key to discovering what google looks at, but now that I know I want to try and implement some custom rewriterules that might help.

 

Basically, I'm looking to modify the rewrite rule for any modules content to include *.htm at the end. I have solid proof that google will rank a page higher (on my site) for anything that contains an extension, as opposed to an open ended URL or flat link.

Example:

http://dev.sitename.com/m/photos/view/decal.htm

^ ranks better than the default:

http://dev.sitename.com/m/photos/view/decal

 

I have come to this conclusion by comparing results of orca forum vs the rest of my sites content. I am able to get every topic to rank on google because topics are served as topicname.htm. It is almost impossible to get anything else to show up if it has what i'd call a flat link (ends with trailing /).

I don't even know if this will function properly, or yield better results, but I'd like to give it a shot. Basic internet research on RewriteRule led me to try this out in .htaccess:

RewriteRule ^photos/view/([^/]+).htm   modules/?r=photos/view/$1 [NC]

But, no dice. Anyone got a quick answer on what I'm doing wrong, or if I'm wasting my time with this theory?

Skype: shawn.nelson
Quote · 29 Apr 2011

Made a couple small corrections:

RewriteRule ^photos/view/([^/]+).htm$ modules/?r=photos/view/$1 [NC,L]

Now I can get to the photo via the following URL:

http://dev.sitename.com/photos/view/decal.htm

 

The new challenge becomes changing the dolphin engine links to the modified convention. I don't even know where to begin here, but I think if I were to submit a site map to google utilizing what I have above, I would already get better search results.

 

My goal is to have this active against all core modules and some 3rd party modules that I have purchased.

Most notably, modzzz's Business Listing mod. He has included a forum for each business listing, that forum landing page is /forum/listing/forum/businessname-0.htm, whereas the link to the business listing itself is '/m/listing/view/businessname'. When I input the businessname into google, I get immediate results for the forum listing, and I get a 100% bounce rate for most of the clicks on these links due to the forums containing no topics. Visitors do not get ambitious enough to click the navigation links at the top of the page, if the first thing they see isn't what they wanted (blank page with the text "There are no topics in this forum"), you can be they hit that back button in a matter of seconds. I know I do!

 

Not sure what help I can solicit for this task, but I genuinely believe a lot of sites could benefit from this. If my theories are flawed, please stop me before I lose any more hair over trying to accomplish this!

Skype: shawn.nelson
Quote · 29 Apr 2011

you must de careful with things like this

http://dev.sitename.com/m/photos/view/decal.htm

^ ranks better than the default:

http://dev.sitename.com/m/photos/view/decal

 

if you make a rewrite change in .htaccess you also must make a 301 redirect from http://dev.sitename.com/m/photos/view/decal to http://dev.sitename.com/m/photos/view/decal.htm,

otherwise you have duplicate content and this is really bad for google.

 

example:

standard from location modul

http://www.ue30-party-portal.de/m/location/view/St-James-Dusseldorf

which is rewritten and redirected to

http://www.ue30-party-portal.de/event-location/St-James-Dusseldorf.html

ue30 Mods - http://www.boonex.com/market/posts/ue30
Quote · 29 Apr 2011

to make it perfect it is not so easy in d7 because you have to change many files for each modul

.htaccess looks like this

 

RewriteRule ^event-location/(.*)\.html$ modules/?r=location/view/$1 [QSA,L]

 

RewriteCond %{REQUEST_URI} ^/m/location/view/(.*)
RewriteRule ^(.*)$ http://www.ue30-party.com/event-location/%1.html [L,R=301]

ue30 Mods - http://www.boonex.com/market/posts/ue30
Quote · 29 Apr 2011

Your theory is flawed in my opinion, a URL with a .htm extension (or any other extension for that matter) does not have any more ranking power over one without an extension.

Quote · 29 Apr 2011

Your theory is flawed in my opinion, a URL with a .htm extension (or any other extension for that matter) does not have any more ranking power over one without an extension.

I used to agree with this & hoped it was true, but the results I am seeing beg to differ. While crawlers seem to be somewhat efficient in following flat links to content, and eventually will parse it - I am seeing that anything with an extension will outweigh a flat link with the same naming.

 

 

to make it perfect it is not so easy in d7 because you have to change many files for each modul

.htaccess looks like this

 

RewriteRule ^event-location/(.*)\.html$ modules/?r=location/view/$1 [QSA,L]

 

RewriteCond %{REQUEST_URI} ^/m/location/view/(.*)
RewriteRule ^(.*)$ http://www.ue30-party.com/event-location/%1.html [L,R=301]

Thank you for the examples, and you raise a very valid point. Changes will have to be made in every module, and I might as well say goodbye to future upgrades with dolphin once I try to implement this. I've shifted my goal a bit, targeting this enhancement for only modules that I want to have better SEO (business directory, classified ads).

Skype: shawn.nelson
Quote · 29 Apr 2011

yes this is very difficult with d7 and updates.

i am also only using this in my event and location modul.

ue30 Mods - http://www.boonex.com/market/posts/ue30
Quote · 30 Apr 2011

I was thinking of doing some SEO editing too, but I'm afraid that if Google goes back to the old url that no longer exists, penalizations begin. I'd like to be able to have members profiles be http://www.mydomain.com/userid instead of their username, that way they could change their username. I have it set so they CAN'T change usernames, just for that reason.

Quote · 30 Apr 2011

While trying to implement another item I'm having issues with, I think I stumbled upon the way to make this work and not get penalized by google. I haven't fully tested it yet (uploading content) but so far so good.

in .htaccess, just above:

RewriteRule ^m/(.*)$  modules/index.php?r=$1 [QSA,L]

I added:

RewriteRule ^photos/view/([^/]+).htm$   modules/?r=photos/view/$1 [NC,L]
RewriteRule ^m/photos/view/(.*)$ /photos/view/$1.htm [R,L]

Now, without altering any code within the platform, I can click any image and it will redirect me to the new permalinks label I came up with... speficially adding *.htm to the end of my photo URLs.

Original link on site still shows as (http://www.website.com/m/photos/view/koda-2010-06-14-0), upon clicking the link, user is redirected to (http://www.website.com/photos/view/koda-2010-06-14-0.htm)

 

From everything I read, as long as it is a 301 redirect (I should probably change it to R=301) it will not be penalized by search engines. Also, because of the redirect, I do not appear to have duplicate content.

 

I now question whether or not it is worth the effort, and if reconstructing permalinks like this will truly prove beneficial over the original scheme?

This all originally stemmed off of my use of modzzz's business listing module, I was finding that the forum section was ranking higher than the actual business listing of the same title. The only difference was the forum url (/forum/listings/forum/Businessname-0.htm) vs the actual listing at (/modules/?r=listing/view/Businessname). I had huge bounce rates for users that would stumble across the empty forum for the business, and I'd rather have them see the main listing page first (I have since removed forums completely from my listings).

 

This might be a true case of "too much time on my hands" Laughing

Skype: shawn.nelson
Quote · 14 Jun 2011

Update - discovered that the pagination component of the video & photo galleries will bomb out when modifying the permalinks like I have described above. This only happens when you are viewing a photo and click on the associated gallery on the same page; I'm sure it can be remedied but don't know where to start.

 

Still having issues setting correct rewrite rule for URLs containing a ?, do I need to escape this char somehow?

Skype: shawn.nelson
Quote · 15 Jun 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.