Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a site that apparently has "dirty URLs". For example a URL that I have goes something like this:

www.website.com/article?articleID=2 or something along the lines of that. This, to me, seems to be the only valid way of using these URL's for a dynamic site. Is there a way to change them to say, www.website.com/article?

share|improve this question
add comment

1 Answer

You should not just remove the ID because it's important to know which article we are opening, you should rewrite it using .htaccess's mod_rewrite.

What will you rewrite it to depends on the nature of your website and your strategic choices, it can be just:

www.website.com/title-goes-here

Or if the title of the article can be found elsewhere, you can make it:

www.website.com/title-goes-here-id

Or even:

www.website.com/category-name/title-goes-here-id

share|improve this answer
    
Is there another way of perhaps sending the ID to the page? –  ReallyGoodPie Aug 1 '13 at 15:31
    
the way of sending the ID through URL won't change, the rewrite engine will receive www.website.com/title-goes-here-id for example and calls www.website.com/article?articleID=id. All you have to do is find some tutorials of .htaccess URL rewriting. –  heytools Aug 1 '13 at 15:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.