Link to home
Start Free TrialLog in
Avatar of WestCoast_BC
WestCoast_BCFlag for Canada

asked on

Understanding URLs when only a path is passed

Can someone please explain to me what is done to support a URL with just a pathname passed. For example, sometimes I see URLs that look something like:
www.mysite.com/products
and the website knows to display products.

My site is written using coldfusion.

How is this done? Is there a sub directory called products which has an index.cfm page?
SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

On ColdFusion server you need index.cfm in that directory and the script in index.cfm does show the Products presentation.

That das say that this three URLs are do the same on ColdFusion application server:

www.mysite.com/products

www.mysite.com/products/

www.mysite.com/products/index.cfm


That is because index.cfm ist the default page when no page is given in the URL path.


Avatar of WestCoast_BC

ASKER

Thank you. If I understand correctly I will have to create a directory and with an index.cfm file for each of these URLs that I would like to support.

I do have a .htaccess file in use. Is there something that I can add that if it encounters this type of URL it can change it to something like: mysite.com/index.cfm?d=products

I see this type of URL used quite a bit and I would like to support this if it is not too hard. I would rather not have to create a directory and index.cfm for each one that I want to support.

You started this Question that you want to understand something.

That part was answered more then enough by  Dr. Klahn


Because you use ColdFusion as Application Server you have more possibilities then explained by the Expert.

But for that you realy need to know what you need and how to get it.


On ColdFusion Aplication Server you have an Administration Dashboard where you can also do Mappinings from Logical paths to directories outside and inside of your web root.


And if you do NOT use the ColdFusion built-in Web Server but some other frontend web server, Apachee, IIS, then you have the possibilties described in the first answer.


I would not recommand doing any of the .htacces of CF Administrations Mapping in the production until you get good feeling how it works.


Additionaly keep in mind that changing  .htaccess and application mappings, on two ends  the configuration always results in ConFusion  :  )

 

Good luck,

Zvonko



ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial