About URL Rewriting...

Reply

Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

About URL Rewriting...

 
0
  #1
Dec 15th, 2008
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
Last edited by Shanti Chepuru; Dec 15th, 2008 at 2:39 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 94
Reputation: sikka_varun is an unknown quantity at this point 
Solved Threads: 11
sikka_varun's Avatar
sikka_varun sikka_varun is offline Offline
Junior Poster in Training

Re: About URL Rewriting...

 
0
  #2
Dec 15th, 2008
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...

  1. RewriteEngine On
  2. RewriteRule ^/products/(.*).html$ /products\.php?category_name=$1

Im not sure about the above code... But even i learnt this from a tutorial...
VâRûN
---Happy to Help---
sikka_varun@yahoo.com
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: About URL Rewriting...

 
0
  #3
Dec 16th, 2008
provide some good tutorials...please....
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 293
Reputation: Aamit has a little shameless behaviour in the past 
Solved Threads: 11
Aamit Aamit is offline Offline
Posting Whiz in Training

Re: About URL Rewriting...

 
0
  #4
Dec 16th, 2008
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
Last edited by Aamit; Dec 16th, 2008 at 2:36 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: About URL Rewriting...

 
0
  #5
Dec 16th, 2008
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....
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: faizurrahman is an unknown quantity at this point 
Solved Threads: 0
faizurrahman faizurrahman is offline Offline
Newbie Poster

Re: About URL Rewriting...

 
0
  #6
Dec 16th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: About URL Rewriting...

 
0
  #7
Dec 16th, 2008
Originally Posted by faizurrahman View Post
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
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 7
Reputation: faizurrahman is an unknown quantity at this point 
Solved Threads: 0
faizurrahman faizurrahman is offline Offline
Newbie Poster

Re: About URL Rewriting...

 
0
  #8
Dec 16th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: About URL Rewriting...

 
0
  #9
Dec 16th, 2008
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.
Last edited by buddylee17; Dec 16th, 2008 at 11:49 am.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: About URL Rewriting...

 
0
  #10
Dec 17th, 2008
thanks to all for their inputs...
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC