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

Recommended Answers

All 10 Replies

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...

provide some good tutorials...please....

url like product.php?prod_id=1 it does not have importance to that URL as search engine sees “?” sign treat it as a url which keeps on changing.
so convert the dynamic URL product.php?prod_id=1 to static url format product-5.html.
So rewrite the url like it display product-1.html but it actually cal product.php?prod_id=1.

so you rewrit url using .htaccess

You can find lots of tutorial on google...like

http://www.freewebmasterhelp.com/tutorials/htaccess/
http://www.easywebtutorials.com/tutorials/htaccess.html
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

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....

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.

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

According to my knowledge shanti you cannot make these type of url without .ini file because these type of url always not work locally. It work only online which is supported by third party tool.
Thanks

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.

thanks to all for their inputs...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.