htaccess help needed :: convert dynamic url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yoursanjay
Forum Newbie
Posts: 17
Joined: Sat Feb 23, 2008 12:21 pm

htaccess help needed :: convert dynamic url

Post by yoursanjay »

Hello,

I have a dynamic website where all the pages and sections are pulling out from Dynamic URLs like
http://www.mysite.com?pageId=5
or
http://www.mysite.com?pageId=9


There are hundreds of these type of links placed in my site and now I prefer to display static URL in the address bar. For example,
If any user click on the link 'http://www.mysite.com?pageId=5', in the address bar the URL it will be converted to 'http://www.mysite.com/service.html' and if clicked on 'http://www.mysite.com?pageId=9', it will be converted to 'http://mysite.com/about,html' and so on.

Will it can be done through htaccess file? If so, what should I write in the htaccess file?

I can not change the dynamic URLs of my site right now because there are hundreds of links are in my site.

Please suggest.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: htaccess help needed :: convert dynamic url

Post by requinix »

Does your database (or whatever you use that stores those page IDs) relate the ID to a page name? In other words, given "/service.html" can you find "5"?
Post Reply