Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
redirect all .php to .cfm
Old 11-17-2006, 03:14 PM redirect all .php to .cfm
Experienced Talker

Posts: 31
Trades: 0
Recently my workplace has changed from Apache to ColdFusion and I would like to redirect everyone to a .cfm extention intead of .php...

We are running a ColdFusion server. Is there anything I can do??
desiram is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2006, 07:11 AM Re: redirect all .php to .cfm
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
simplest way would be to set coldfusion to parse files with a .php extension

other than that (not knowing much at all about CF), your options may be limited to a custom 404 page and some code to replace the page extensions then redirect.

HowTo;
Grab the Querystring passed to the 404 page
Replace the "404;" ( The original URI is passed to the error page as 404;original_url )
Replace the ".php" with ".cfm" (assuming you are using the same page names)
Redirect using the code below (only bit of CF I know well enough)

Code:
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="new_url">
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to redirect all .php to .cfm
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10075 seconds with 12 queries