Connecting Tech Pros Worldwide Help | Site Map

Clean URLs

Member
 
Join Date: Feb 2007
Posts: 75
#1: Apr 16 '09
i have been trying a hell lot to achieve the task of cleaning my urls but has not been able to succed. I downloaded the example codes from http://www.lucabiagini.com/2008/03/p...friendly-urls/ in order to understand the way and tried it in my machine. But even this example do not work in my machine. Do not work in the sense that when i click on an archive entry i am directed to the url http://localhost/ex/single.php?id=1. This means the url is not in the form as it ought to be.

I am using WAMP. i am sure this example sampe is working perfectly and there might be some other way to deal for the solution in WAMP. Please advice me!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#2: Apr 16 '09

re: Clean URLs


but you have Apache with a working mod_rewrite?
Member
 
Join Date: Feb 2007
Posts: 75
#3: Apr 16 '09

re: Clean URLs


Quote:

Originally Posted by Dormilich View Post

but you have Apache with a working mod_rewrite?

yes i have done it ...............................
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#4: Apr 16 '09

re: Clean URLs


what does your .htaccess file look like?
Member
 
Join Date: Feb 2007
Posts: 75
#5: Apr 17 '09

re: Clean URLs


infact today i am with somewhat a better picture in understanding the clean urls. In case of me what i wanted was to transform url something like this.
Expand|Select|Wrap|Line Numbers
  1. http://www.mysite.com/record.php/202
  2.  
instead of
Expand|Select|Wrap|Line Numbers
  1. http://www.mysite.com/record.php?id=202
where the id value is from mysql database.

People usually have tutorials which teaches us how to write the htaccess file without giving the details of whole scenario. In my case i think its not just writing into htaccess file that will suffice my need. i think we have to write some php script also to achieve this. So, this is what i wanna know?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#6: Apr 17 '09

re: Clean URLs


to be honest, I don't see the necessity to use PHP too. usually a correct .htaccess file should do it.
Member
 
Join Date: Feb 2007
Posts: 75
#7: Apr 17 '09

re: Clean URLs


Quote:

Originally Posted by Dormilich View Post

to be honest, I don't see the necessity to use PHP too. usually a correct .htaccess file should do it.

i see, ok then please direct me how to do it if you dont mind.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,642
#8: Apr 17 '09

re: Clean URLs


read here or here. this should get you started.
mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 719
#9: Apr 19 '09

re: Clean URLs


A simple and good tutorial on URL rewriting http://corz.org/serv/tricks/htaccess2.php
Reply