Long time I am trying to define Rewriting rules but I could not succeed yet? I have a simple page http://www.myURL.com/pdf.php?id=2. I want to make it friendly by this: http://www.myURL.com/pdf/2/ ...
I wrote this rule after spending time on google:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^pdf/([0-9]+)\$ pdf.php?id=$1.
When I uploaded my .htaccess file on server and try to run first it give me 500 ERROR. Second time it loaded page but it could not show me friendly URL; it was showing as before. Kindly tell me better solution, I followed many instructions to make it useful but could not successful. My Client are not going further unless I showed him friendly URL. kindly help me as soon as possible. This is my client hosting Organization: Justhost.com.
Here is a very simple tutorial on using Apache's mod_rewrite to create friendly URLs.
You can do this using Apache's Rewrite Engine. Something like this:
This will allow you to go to http://yoursite.com/pdf/192 instead of http://yoursite.com/pdf.php?id=192
Probably a bit too much to take just right now but you could look at some of the available MVC frameworks to help you solve this. I'm guessing that the host only offers PHP 5.2 so I'd take a look at the routing/controller solution from Zend Framework 1.12 to solve this as that can be implemented into existing code without too much trouble.