After rewrite, controller not invoked

60 views
Skip to first unread message

John K

unread,
May 7, 2012, 1:30:48 AM5/7/12
to framework-one
Hello all,

Just getting started with FW/1 and attempting to get the index.cfm out
of the URL string. I used the mod_rewrite code for .htaccess provided
in the documentation:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(assets|cfide|files|images|js|css|views|
layouts|index.cfm) [NC]
RewriteRule ^(.*)$ /index.cfm/$1

This rewrites the URL fine and removes the index.cfm. However, after
implementing this rewrite, my controllers are not called. For example,
if I load: http://localhost/main/default/, the view shows. But the
default() method in main.cfc is not invoked.

I have SESOmitIndex = true AND generateSES = true, but that makes no
difference. If I turn the URL rewrite off and try http://localhost/index.cfm/main/default,
the main.default() is called fine and everything works. I'm stumped.

I would appreciate any help with this. Thanks in advance.

CF: 9,0,1,274733
FW/1: 2.0.1

John K

unread,
May 7, 2012, 11:20:36 PM5/7/12
to framework-one
Fixed by adding this to the rewrite rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Suggest adding this to the documentation, possibly.

Hope this helps someone in the future.


On May 7, 1:30 am, John K <johnkling...@yahoo.com> wrote:
> Hello all,
>
> Just getting started with FW/1 and attempting to get the index.cfm out
> of the URL string. I used the mod_rewrite code for .htaccess provided
> in the documentation:
>
> RewriteEngine on
> RewriteCond %{REQUEST_URI} !^/(assets|cfide|files|images|js|css|views|
> layouts|index.cfm) [NC]
> RewriteRule ^(.*)$ /index.cfm/$1
>
> This rewrites the URL fine and removes the index.cfm. However, after
> implementing this rewrite, my controllers are not called. For example,
> if I load:http://localhost/main/default/, the view shows. But the
> default() method in main.cfc is not invoked.
>
> I have SESOmitIndex = true AND generateSES =  true, but that makes no
> difference. If I turn the URL rewrite off and tryhttp://localhost/index.cfm/main/default,

Sean Corfield

unread,
May 7, 2012, 11:34:18 PM5/7/12
to framew...@googlegroups.com
On Mon, May 7, 2012 at 8:20 PM, John K <johnkl...@yahoo.com> wrote:
> Fixed by adding this to the rewrite rules:
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
>
> Suggest adding this to the documentation, possibly.

Anyone can update the documentation (if they have a github account). I
didn't author that page and hadn't even noticed a RewriteRule example
was in the documentation. Feel free to edit it.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

ehm77

unread,
May 8, 2012, 2:03:05 PM5/8/12
to framew...@googlegroups.com
I didn't even realize I could edit that...'wiki' should have been a giveaway.

I updated the sample.  The old one definitely did not work with subsystems.  Feel free to improve upon it.

Sean Corfield

unread,
May 8, 2012, 4:48:22 PM5/8/12
to framew...@googlegroups.com
Thanx!

Grant Powell

unread,
Mar 3, 2017, 12:15:58 PM3/3/17
to framework-one, seanco...@gmail.com
This does NOT work.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !^/(assets|cfide|files|images|js|css|views|layouts|index.cfm) [NC] 
RewriteRule ^(.*)$ /index.cfm/$1 

Matt Quackenbush

unread,
Mar 3, 2017, 12:20:44 PM3/3/17
to framew...@googlegroups.com
Yes, it does. Countless millions of sites use it. You obviously have something wrong with your setup, but you've provided us no information to help you with.

Please stop finding old threads and replying to them. Please read the link that I've already provided for you twice (here it is again), and add all of the relevant information to the thread that you started a few minutes ago.



--
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-one+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/framework-one.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages