Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Problem regarding URL Rewriting



9:33 am on Jan 12, 2010 (gmt 0)

5+ Year Member

Hello All,
I am Samit, new in this forum. I am in the SEO field for the last one year, but as an junior. Recently I have been promoted to a the next level and I got opportunity to work on a dynamic website. Can't post the URL due to some privacy reason.

Unfortunately in my first project I got stuck with a URL rewriting issue. All the pages of the site are dynamic with dynamic URLs. I would like to rewrite them. But developer need help from me that how to do that. As a non technical person really unable to help them.

I found this forum can help me regarding that. Let me give you a view of the issue.

For example:

A URL of one of the page of the site is "http:// www.domain.com /view_all.php?catid=0&subcatid=3&sub_catid=78". What can be done to rewrite the URL properly to make the URL static. The site has almost 106 pages in this format. I hope if I get guidance about one, that can help me to do the others.The site is hosted in apache server.

Waiting for a feedback.



2:52 pm on Jan 12, 2010 (gmt 0)

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

You do not "rewrite URLs to make them static" -- This cannot be done by the server.

What you can do is:
1) Replace all links on your pages with static URLs (Change the database or use something like preg_replace in PHP to do it).
2) Add server config code (e.g. mod_rewrite directives) to "re-connect" these new static URLs with your server-side script(s) by rewriting the incoming static URL requests to the dynamic form required to invoke your script.
3) As a final and optional third step, externally redirect all direct client requests for 'old' dynamic URLs to the new static URLs. This is useful only in recovering traffic from pre-existing third-party links and bookmarks, and in speeding up the removal of the old dynamic URLs from search engines. It is, as stated, the very last step, and it is optional.

For more information, see the threads like this one [webmasterworld.com] in our Apache Forum Library, and the resources cited in our Apache Forum Charter. Also, please note that we do not allow members to post the URLs of their own sites here, or of any other sites unless they are well-known and respected (and mostly-non-commercial) reference sites for Webmaster information. The *only* domain not subject to removal is "example.com," because it is reserved and cannot be owned or controlled by any individual or company.

Note that the 'friendly' URL must contain all of the information needed to 'build' the dynamic script call; The server has only this information to work with as the request is received from the client.

Similarly, the URLs must be designed so that the reverse is also possible if you wish to implement the optional third step described above.



7:57 am on Jan 14, 2010 (gmt 0)

5+ Year Member

Thanks for the nice and detail explaination. I have forwarded this to the development team.

The actual problem and my concern is as follows:

Developers did the rewrite first time (I don't know how). After the static URLs are reachable from the site only. But from any link or google if visitors click on the link they land on the exact page but with dynamic URL. As per as my knowledge after rewrite and redirection visitors should land on the page with a static URL in address bar. Otherwise duplicate content issue can be there.

My senior said the previous situation (that done by our developers) was not an issue.

I don't know whether I able to explain the situation perfectly or not. If you can guide on the above mentioned situation, that would be great help for me.


8:26 am on Jan 14, 2010 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

If dynamic URL is requested, server should return single-step 301 redirect to static URL.

If static URL is requested, server should return content with 200 OK status, and return 404 Not Found for non-valid requests.


9:35 am on Jan 14, 2010 (gmt 0)

5+ Year Member

Then what I am concern about (problem for duplicate content) is right, isn't it?


11:39 am on Jan 14, 2010 (gmt 0)

5+ Year Member

this is complete responsibility of your developer team to develop rewriting procedure for your web site. I am also doing SEO and i never write coding for rewriting URL's I just told to my developer team and they complete the task with in time. Currently development team develop new website in magento and there is no need to write code for mod rewrite because it is already embed in magneto.

[edited by: jdMorgan at 8:46 pm (utc) on Jan. 14, 2010]
[edit reason] No URLs, please, See Terms of Service. [/edit]


8:55 pm on Jan 14, 2010 (gmt 0)

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

> Then what I am concern about (problem for duplicate content) is right, isn't it?

Yes, it's a concern. Duplicate content exists when the same content can be directly reached by using more than one, single, canonical URL.

One and only one canonical URL should be usable to reach a given 'piece of content.' Any and all variations on that URL - protocol, domain, subdomain, Non-FQDN/FQDN-format hostname, port number, URL-path, query string, or capitalization differences should result in either a 301-Moved Permanently redirect to the correct URL, or in a 404-Not Found response.

The problem appears to be that the job was only two-thirds finished: The on-page links were changed, an internal rewrite was implemented, but no 301 redirect from the old URLs to the new ones was implemented.



7:12 am on Jan 16, 2010 (gmt 0)

5+ Year Member

Thanks for the nice explaination!

As it is my first project (I managed solely) I want to give the best services to my client. But now as this rewrite issue is being taken care wrongly as per the suggestion of my senior - I think the site will surely suffer.

My request to the senior members of this, please suggest me what to do in this type of situation. I know I am demanding something big, but please help me out.


8:33 am on Jan 16, 2010 (gmt 0)

5+ Year Member

Adding to my previous post, I would like to explain what the theory of my senior:

1. Update the User sitemap and xml sitemap, so Google will crawl the new URL format.

2. After sometimes Google will autometically delete the old URLs and index the new URLs. (In my opinion it can't untill proper 301 redirection is in place to redirect all the request to the old URL format to the new).

3. Untill and unless, request to the old URLs are landing the visitors in a 404 error page, no hurm is there.

May be some people can think that these thread is just to prove my senior wrong and I want to win in some personal war. But nothing like this in my mind. I felt he is doing something wrong and that can hurt the site. I just want to save the site.

Waiting for response from the seniors here.


3:28 pm on Jan 16, 2010 (gmt 0)

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

Adding the canonicalization code does four things: It speeds up the re-indexing of the site so that your new URLs appear in search results faster, it tells the search engines to "assign" the PageRank and Link-Popularity factors of the old URLs to the new URLs, it prevents duplicate-content problems, and it preserves traffic from old user bookmarks and links on the Web.

Leaving it out just means you won't get any of these benefits.

A note on your specific requests for assistance from "seniors" here: The WebmasterWorld membership-ranking function is largely meaningless, as it it based only on post-count. It is a gauge only of "participation level" in the community here, and does not necessarily reflect skill or experience. Therefore, you may find that some of the best and most useful posts are made by "New User" and "Junior" members: They may not post very often because they're very busy running some of the biggest sites on the Web, but when they do post, it's very worthwhile to read what they have to say...

Similarly, we try to stick to technical issues in this forum, so the only reason that matters regarding your inquiries about these canonicalization issues is that "it's important to get everything right on your site."



Featured Threads

Hot Threads This Week

Hot Threads This Month