.htaccess mode rewrite:

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
psaha
Forum Newbie
Posts: 16
Joined: Mon Oct 26, 2009 4:11 am

.htaccess mode rewrite:

Post by psaha »

Please, provide the .htaccess and/or php code which convert URL

http://www.mysite.com/?book=1257153985
to
http://www.mysite.com/book-1257153985

I have used
RewriteEngine On
RewriteRule /(.*)$ /index.php?book=$i
BUT not working
Please help!
psaha
Forum Newbie
Posts: 16
Joined: Mon Oct 26, 2009 4:11 am

Re: .htaccess mode rewrite:

Post by psaha »

Okay Okay.. I have done it.
---------------------------
RewriteEngine on
RewriteRule ^book-([^/]+)/?$ /index.php?book=$1
---------------------------
Post Reply