Avatar of WestCoast_BC
WestCoast_BC
Flag 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?
Web DevelopmentColdFusion Language

Avatar of undefined
Last Comment
Zvonko

8/22/2022 - Mon
SOLUTION
Dr. Klahn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Zvonko

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

Zvonko

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.


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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Zvonko

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
Zvonko

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.