0
Friendly URL's in Coldfusion
New Here
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/td-p/787114
Apr 21, 2006
Apr 21, 2006
Copy link to clipboard
Copied
How could I change a typical parameterized URL in my
application such as
http://www.domain.com/index.cfm?id=977
to the following friendly URL for example (or similar)
http://www.domain.com/index.cfm/news/sample-headline
Any ideas ?
http://www.domain.com/index.cfm?id=977
to the following friendly URL for example (or similar)
http://www.domain.com/index.cfm/news/sample-headline
Any ideas ?
TOPICS
Advanced techniques
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787115#M73080
Apr 21, 2006
Apr 21, 2006
Copy link to clipboard
Copied
In your example, the variable CGI.PATH_INFO would return the
value "/index.cfm/news/sample-headline".
You can treat this as a list delimited by "/" or strip out the name of the script to get the variable information you need.
Is that what you mean?
You can treat this as a list delimited by "/" or strip out the name of the script to get the variable information you need.
Is that what you mean?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
rambo
AUTHOR
New Here
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787116#M73081
Apr 24, 2006
Apr 24, 2006
Copy link to clipboard
Copied
Kind of.
Basically what I have now is when a page gets called from the database table the URL is in the form of
http://www.domain.com/index.cfm?id=977
Is it possible to turn (or mask) the url above into a Search engine friendly URL such as
http://www.domain.com/news/headline (if its a press release)
http://www.domain.com/vacancies/jobtitle (if its a job vacancy) etc...
perhaps based from the metadata?
How would the CGI.PATH_INFO return the value "/index.cfm/news/sample-headline".
Basically what I have now is when a page gets called from the database table the URL is in the form of
http://www.domain.com/index.cfm?id=977
Is it possible to turn (or mask) the url above into a Search engine friendly URL such as
http://www.domain.com/news/headline (if its a press release)
http://www.domain.com/vacancies/jobtitle (if its a job vacancy) etc...
perhaps based from the metadata?
How would the CGI.PATH_INFO return the value "/index.cfm/news/sample-headline".
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787117#M73082
Apr 24, 2006
Apr 24, 2006
Copy link to clipboard
Copied
rambo wrote:
> Kind of.
>
> Basically what I have now is when a page gets called from the database table
> the URL is in the form of
>
> http://www.domain.com/index.cfm?id=977
>
> Is it possible to turn the url above into a Search engine friendly URL such as
>
> http://www.domain.com/news/headline (if its a press release)
>
> http://www.domain.com/vacancies/jobtitle (if its a job vacancy) etc...
>
> perhaps based from the metadata?
>
> How would the CGI.PATH_INFO return the value "/index.cfm/news/sample-headline".
>
http://ray.camdenfamily.com/index.cfm/2005/8/2/Ask-a-Jedi-Working-with-SES-URLs-and-ColdFusion
--
Matt Woodward
mpwoodward@gmail.com
Adobe Community Expert - ColdFusion
> Kind of.
>
> Basically what I have now is when a page gets called from the database table
> the URL is in the form of
>
> http://www.domain.com/index.cfm?id=977
>
> Is it possible to turn the url above into a Search engine friendly URL such as
>
> http://www.domain.com/news/headline (if its a press release)
>
> http://www.domain.com/vacancies/jobtitle (if its a job vacancy) etc...
>
> perhaps based from the metadata?
>
> How would the CGI.PATH_INFO return the value "/index.cfm/news/sample-headline".
>
http://ray.camdenfamily.com/index.cfm/2005/8/2/Ask-a-Jedi-Working-with-SES-URLs-and-ColdFusion
--
Matt Woodward
mpwoodward@gmail.com
Adobe Community Expert - ColdFusion
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
rambo
AUTHOR
New Here
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787118#M73083
Apr 24, 2006
Apr 24, 2006
Copy link to clipboard
Copied
Thanks for that
How would you use the code below in your site that would change the actual URL ?
<cfset pathInfo = reReplaceNoCase(trim(cgi.path_info), ".+\.cfm/? *", "")>
<cfoutput>
cgi.path_info=#cgi.path_info#<br>
stripped: #pathInfo#
</cfoutput>
E.G.
If my link was
http://www.domain.com/direct/execs/newsdetail.cfm?id=#id#"
How could the code be used to change the above to
http://www.domain.com/direct/execs/newsdetail.cfm/24/04/2006/news-headline
like the examples ray camden has on his site
i.e. http://ray.camdenfamily.com/index.cfm/2006/4/21/Advanced-ColdFusion-Contest-Winner
How would you use the code below in your site that would change the actual URL ?
<cfset pathInfo = reReplaceNoCase(trim(cgi.path_info), ".+\.cfm/? *", "")>
<cfoutput>
cgi.path_info=#cgi.path_info#<br>
stripped: #pathInfo#
</cfoutput>
E.G.
If my link was
http://www.domain.com/direct/execs/newsdetail.cfm?id=#id#"
How could the code be used to change the above to
http://www.domain.com/direct/execs/newsdetail.cfm/24/04/2006/news-headline
like the examples ray camden has on his site
i.e. http://ray.camdenfamily.com/index.cfm/2006/4/21/Advanced-ColdFusion-Contest-Winner
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787119#M73084
Apr 24, 2006
Apr 24, 2006
Copy link to clipboard
Copied
rambo wrote:
> Thanks for that
>
> How would you use the code below in your site that would change the actual URL
> ?
>
> <cfset pathInfo = reReplaceNoCase(trim(cgi.path_info), ".+\.cfm/? *", "")>
>
> <cfoutput>
> cgi.path_info=#cgi.path_info#<br>
> stripped: #pathInfo#
> </cfoutput>
>
> E.G.
>
> If my link was
> http://www.domain.com/direct/execs/newsdetail.cfm?id=#id#"
>
> How could the code be used to change the above to
>
> http://www.domain.com/direct/execs/newsdetail.cfm/24/04/2006/news-headline
>
> like the examples ray camden has on his site
>
> i.e.
> http://ray.camdenfamily.com/index.cfm/2006/4/21/Advanced-ColdFusion-Contest-Winn
> er
>
>
>
I haven't had to mess with SES URLs myself, but there's some additional
information here:
http://www.houseoffusion.com/
Just scroll down a bit for the article "Search Engine Safe (SES) URLs"
by Michael Dinowitz.
Matt
--
Matt Woodward
mpwoodward@gmail.com
Adobe Community Expert - ColdFusion
> Thanks for that
>
> How would you use the code below in your site that would change the actual URL
> ?
>
> <cfset pathInfo = reReplaceNoCase(trim(cgi.path_info), ".+\.cfm/? *", "")>
>
> <cfoutput>
> cgi.path_info=#cgi.path_info#<br>
> stripped: #pathInfo#
> </cfoutput>
>
> E.G.
>
> If my link was
> http://www.domain.com/direct/execs/newsdetail.cfm?id=#id#"
>
> How could the code be used to change the above to
>
> http://www.domain.com/direct/execs/newsdetail.cfm/24/04/2006/news-headline
>
> like the examples ray camden has on his site
>
> i.e.
> http://ray.camdenfamily.com/index.cfm/2006/4/21/Advanced-ColdFusion-Contest-Winn
> er
>
>
>
I haven't had to mess with SES URLs myself, but there's some additional
information here:
http://www.houseoffusion.com/
Just scroll down a bit for the article "Search Engine Safe (SES) URLs"
by Michael Dinowitz.
Matt
--
Matt Woodward
mpwoodward@gmail.com
Adobe Community Expert - ColdFusion
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
LATEST
/t5/coldfusion-discussions/friendly-url-s-in-coldfusion/m-p/787120#M73085
Apr 24, 2006
Apr 24, 2006
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

