About URL Rewriting...
Im shanti..
I am developing one dynamic site ,
here my product display page is like products.php?prod_id=1
It means the products under first category are displayed..
but i want my url like products/categoryname.html..something like this, with my category name...which will spiderable format..
Please help me to do this...
All helps are much appreciated
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
Hi..
Im also new to this concept... But i think i can try...
All this can be done in the .htaccess file in the root folder of your website...
You can search on mod_rewrite or rewriterule on google to get more tutorials and details...
RewriteEngine On
RewriteRule ^/products/(.*).html$ /products\.php?category_name=$1
Im not sure about the above code... But even i learnt this from a tutorial...
sikka_varun
Junior Poster in Training
94 posts since Dec 2008
Reputation Points: 11
Solved Threads: 12
provide some good tutorials...please....
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
thanks amit for your clear explanation....
can you post correct code for the above example , you have specified..
and tel me where to put the .htaccess file,if my products page is in another folder...
thank you for your reply....
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
If you want to use html url instead of the actual url then you have to use third party tool for this. Then you have to made httpd.ini file on the root of your site and keep all the html url in it. But you should first understand the regular expression to use these type of url otherwise your url may not work correctly.
thanks for your reply...
can i make these type of urls with out httpd.ini file...if so tel me how to do that??????
thanks
shanti
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162
thanks for your reply...
can i make these type of urls with out httpd.ini file...if so tel me how to do that??????
You'll probably have to enable mod rewrite by uncommenting a line in the http.conf file located in apache/conf/ folder. You won't be able to mod rewrite without first enabling it.
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
thanks to all for their inputs...
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162