Copy link to clipboard
Copied
I've been searching all over google and these forums and kind of have an understanding on how to do this, but i just can't figure this out with regex. I know there is a way to rewrite urls using mod_rewrite to make coldfusion urls seo friendly but it just doesn't work for me lol....
This is the url i currently have:
domain.com?type=soccer&zip=33141
I'm trying to get it to be
domain.com/soccer/33141
And then also have all the links within the page be re-written as well so when the spiders look at it, all the links look like:
domain.com/soccer/33141 or domain.com/basketball/33139
Copy link to clipboard
Copied
You might have better luck with this question on an Apache specific forum, if Apache is your web server. AFAIK ColdFusion does not handle URL re-writing; this is handled by the web server (Apache or IIS).
Copy link to clipboard
Copied
Have you looked into the Ionics Isapi Rewrite Filter? It's free and pretty simple to use. Of course, you need to have acess to your server in order to use it...but other than that, I've had nice luck with it.
Copy link to clipboard
Copied
You can use regular expressions \&(.)*= and \?(.)*= as shown below:
<cfset myURL = "domain.com?type=soccer&zip=33141" />
<cfset myURL = "#REReplaceNoCase('#myURL#','\&(.)*=','/')#" />
<cfset myURL = "#REReplaceNoCase('#myURL#','\?(.)*=','/')#" />
<p><cfoutput>#myURL#</cfoutput></p>
Copy link to clipboard
Copied
Thank you all for your help, that wax exaclty what i was looking for.