Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Using Mod_Rewrite to aid google indexing dynamic pages

How do you rewrite a lentghy dynamic url into a more compact indexable url?



4:03 am on Nov 6, 2002 (gmt 0)

10+ Year Member

Looking for a bit of help with the following:

My e-commerce site is created through Miva Merchant 4.12. It is obvious that the there are two problems with the url's Miva generates that lead to google not indexing them.

#1 the "?" apparent in all urls

#2 the length of most of these urls are extremely long

So with help from this site and others I have learned of the possible solution of using the mod_rewrite module that is available on my hosts apache server. I understand to create an .htaccess file in my directory but I cannot find a clear example of the actual programming command needed to do the mod_rewrite.

For example how would I write a command to make the following change:

I want to rename url:



or something similar that is more compact and simple. Does anyone have any idea of how to do this. I figure once I have one example I can copy it for my other urls. I have visited apache's resource site and other mod_rewrite sites but they are so complicated I cannot find what I am looking for.

Thanks so much in advance to any helpers out there.



6:23 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Welcome tylerh! We're not ignoring you, I promise! :)

Your request is beyond my meager mod_rewrite skills but it's "child's play" for some of our regulars. Can someone offer this new member a little help?


6:36 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

When talking about miva, in particular, they have some type of module that outputs static pages with simple url's.

I am not exceptionally miva enlightened but people keep telling me how well that module/option works.


8:59 pm on Nov 11, 2002 (gmt 0)

10+ Year Member

Thanks...I had just about given up hope on getting a reply. I have tried two different modules for outputting static pages. One of them made the pages look much different then my store pages which I didn't care for. (Not just different ... they looked unprofessional). The other wasn't too bad in appearance but this is my problem. Besides Miva's shortcomings with its static url's it also has no flexibility in giving you the ability to create your meta title and tags for the different pages. It uses the same for every page. So I create mirror pages myself and put in my title etc.. this has worked quite well. So the problem is if I use one of the modules to generate the static pages it will just copy the same poor meta info from miva and basically hurt my overall SERP's. My current system works but when you start talking about thousands of pages it becomes near impossible to stay on top of all the manual updating. I had read some info about mod re-write and though I don't fully understand it, I though maybe it would be a solution for making all my pages crawlable without having to go the mirror page route.

If not then I will keep doing what I am doing...when I can.



10:02 pm on Nov 11, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member


mod_rewrite can do what you asked for, but rewriting this way is not a good solution because it requires an external redirect on each access to an object (page, graphic, script, etc.).

The way to avoid that is to use and publish short readable links, and translate (internally redirect) those into the complex script-parameter-passing URLs for use only inside your site. What you asked for is a way to do the opposite, which would require you to redirect the user's browser and the search engine robots for every access:

Rewrite [widget.com...]  
.....to http:/widget.com/redwidgets.html

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^Screen\=CTGY\&Store\_Code\=GE\&Category\_Code\=1\+(.*)$
RewriteRule ^Merchant2/merchant\.mv$ /%1.html [R=301,L]

Technically this should work, but I don't think it does what you really want to do. :(

Mod_rewrite documentation [httpd.apache.org]



7:54 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Would one have to tweak the code that generates the output pages so that the link structure matches the rewritten URLs?


8:13 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member


I'm not sure which approach you're asking about here, but the idea is to present the client browser or robot with short, concise "friendly" URLs, and then translate requests for those URLs to whatever is needed internal to your server to access the requested resource.

For example, the users and robots see "mydomain.com/big-red-widgets", but the actual URL might be mydomain.com/homecare/shopping.pl?userid=1234567890&refer=ebay&prod=widget&size=large&color=red&sale=true

So yes, any link "seen" by the user's browser or by a robot should be the "friendly" URL. It would not be necessary to use "friendly" URLs for images or scripts, but any link the user might click on, or any link you might want a robot to follow should be "friendly".

Obviously, this kind of technique is best implemented from the start of a new site design.



6:27 pm on Nov 12, 2002 (gmt 0)

10+ Year Member


Thanks for the suggestion. I will think about it some more and maybe give it a try. I'll let you know how it works.


Featured Threads

Hot Threads This Week

Hot Threads This Month