Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

trouble to access to database after rewriting url with cfwheels

New Here ,
May 16, 2025 May 16, 2025

I'm looking for advices about the rewriting URLs fonction of cfWheels. I'm running an app on Adobe ColdFusion 2025, cfWheels 2.5.1 and CommandBox

I'm looking for rewriting URLs of the website (suppress the"/index.cfm/" prefix) and it works! great! BUT I don't have access to my CFIDE Admin Page, my Database and the cfWheels Routes Page.

I have to share with you my .htaccess code:

 

Options +FollowSymLinks

RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^ - [L] RewriteCond %{REQUEST_URI} ^/(CFIDE|cfide|CF_scripts|cf_scripts|wheels/routes) [NC]

RewriteRule ^ - [L] RewriteCond %{REQUEST_URI} ^/index.cfm/(.*)$ [NC]

RewriteRule ^index.cfm/(.*)$ /$1 [R=301,L]

RewriteRule ^(.*)$ /index.cfm/$1 [QSA,L] 

 

There is my settings.cfm:

 

<cfscript>

set(coreTestDataSourceName="manytomany");

set(dataSourceName="manytomany");

set(URLRewriting="On");

</cfscript> 

 

There is my server.json:

{

"app":{"cfengine":"adobe@2025" },

"name":"cf2025_project",

"web":{ "rewrites":{ "config":".htaccess", "enable":true },

"servletPassPredicate":"true" }

If someone have a idea of what's wrong with that? Thanks for your help!

239
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2025 May 16, 2025

Alexandre, since you're using cfwheels, you may get better help at the site and forum devoted to that, a s offered at https://cfwheels.org/.

 

Then, too, the fact that you show using a server.json file tells us you're using commandbox. And as that uses its own web server by default and has its own rewrite capabilities, you may well need to look at this from a Commandbox perspective. And for that you might want to raise this at the ortus Commandbox forums, https://community.ortussolutions.com/c/communities/commandbox

 

But perhaps someone may step in here, recognizing something to suggest based on what you have shared. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 16, 2025 May 16, 2025

Thanks a lot Charlie for your answer!

 

You're right I'm gonna also check on cfwheels an ortus community. I'm new in Cf world and I didn't think about it.

 

Alexandre

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2025 May 16, 2025

Glad to have helped. Hope it goes well for you, there or here. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2025 May 18, 2025
LATEST

What happens when you try this one?

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteCond %{REQUEST_URI} ^/(CFIDE|cfide|CFIDE/.*|cf_scripts|CF_scripts|wheels/routes) [NC]
RewriteRule ^ - [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/index\.cfm/([^\s\?]*) [NC]
RewriteRule ^index\.cfm/(.*)$ /$1 [R=301,L]
RewriteRule ^(.*)$ /index.cfm/$1 [QSA,L]
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources