Forum Moderators: phranque

Message Too Old, No Replies

Rewrite Situation

         

bobbonew

2:12 am on Mar 31, 2009 (gmt 0)

10+ Year Member



I've read the re-write guides, but I just can't get this work.

I want to make:

domain.com/question.php?fn=view&id=444

to

domain.com/444-these-words-dont-matter.htm

I don't want to make the .htm page show up in my logs as a 404 which is what a lot of them carry with them. I'm absolutely stumped. Any insights, not even the answer would be helpful. Thanks!

jdMorgan

3:24 am on Mar 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best-effort code as a basis for discussion, so we know where to start.

Be aware that "these-words-dont-matter" is a potential time-bomb. It invites serious duplicate-content problems in search ranking, and it invites googlebombing by your competitors, who could easily undertake a campaign to see that the URL "your-site.com/444-the-most-fraudulent-and-dishonest-site-on-the-web-today.htm" ranks number one for all of your most-important keywords. Make darn sure that your "question.php" script fully-validates that part of the URL and sends either a 404 response or a 301 redirect to the correct, single, canonical URL for "444" unless the "dont-matter" string is exactly what you expected.

For basic info on your static/SEO-friendly-URL -to- script-filepath rewriting question, see Changing Dynamic URLs to Static URLs [webmasterworld.com] in our Apache Forum Library.

Thanks,
Jim

g1smd

9:51 am on Mar 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



To make the new URLs work, the most important step is that the links on the pages of your site will need to point to those new URLs. It is links that define URLs.

To connect those new URL requests to the real internal script location, you'll need a rewrite.

To force people using the old URLs to update to using the new URLs you'll need a 301 redirect, placed before the rewrite.