Right now, my Apache virtual host looks like this:
<VirtualHost *:80>
DocumentRoot "D:/Websites/cold-test/public"
ServerName cold-test.local
ErrorLog "logs/cold-test.log"
</VirtualHost>
My .htaccess looks like this:
RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /index.cfm/$1 [L,NC]
Accessing http://cold-test.local/testcontroller brings up a page with
only ColdMVC debug information. It lists the following information:
ColdMVC Version: 2.0.5
Module: default
Controller: public
Action: testcontroller
View: public/testcontroller.cfm
Layout: public
Format: html
Route Pattern: /:controller?/:action?/:id?
Route Name:
Status: 200 OK
Environment: development
Development: true
As you can see, it's definitely picking up the incorrect information
for controller, action, view, and layout. I'm not really an Apache
wizard, so this is probably something very simple.
Thanks!
Sean Walsh
@THEseanwalsh
<VirtualHost *:80>
DocumentRoot "D:/Websites/cold-test"
ServerName cold-test.local
ErrorLog "logs/cold-test.log"
</VirtualHost>
RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ public/index.cfm/$1 [L,NC]
On Dec 3, 1:04 pm, Sean Walsh <sean.wals...@gmail.com> wrote:
> I'd like to access my ColdMVC application athttp://domain.com/controller/action/id.
>
> Right now, my Apache virtual host looks like this:
>
> <VirtualHost *:80>
> DocumentRoot "D:/Websites/cold-test/public"
> ServerName cold-test.local
> ErrorLog "logs/cold-test.log"
> </VirtualHost>
>
> My .htaccess looks like this:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{SCRIPT_FILENAME} !-f
> RewriteCond %{SCRIPT_FILENAME} !-d
> RewriteRule ^(.*)$ /index.cfm/$1 [L,NC]
>
> Accessinghttp://cold-test.local/testcontrollerbrings up a page with
You may want to consider pointing your DocumentRoot to your
application's public directory -- this way all your non-public files
are not accessible through the URL (i.e. cold-test.local/config/
config.ini or any secure documents uploaded to your site).
Your VirtualHost would then look like this:
<VirtualHost *:80>
DocumentRoot "D:/Websites/cold-test/public"
ServerName cold-test.local
RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.cfm/$1 [L,NC]
ErrorLog "logs/cold-test.log"
</VirtualHost>
I'm not an Apache guru either, nor do I currently have the time to
give the re-write rules much thought... regardless, here is an example
of what is working for my sites:
<VirtualHost *:80> DocumentRoot "C://workspace/test-site/public"
ServerName test-site.local RewriteEngine on #if request does not
have an extenstion, pass to /index.cfm; files with extensions
(.js, .gif, .html, etc.) are handled normally by Apache.
RewriteCond %{REQUEST_FILENAME} !^.*?\.[^/]{2,5}$ RewriteRule (.*) /
index.cfm$1 [PT] ErrorLog "logs/test-site.log"</VirtualHost>
Home this helps,
Ryan
> > Accessinghttp://cold-test.local/testcontrollerbringsup a page with
<VirtualHost *:80>
DocumentRoot "C://workspace/test-site/public"
ServerName test-site.local
RewriteEngine on
#if request does not have an extenstion, pass to /index.cfm;
files with extensions (.js, .gif, .html, etc.) are handled normally by
Apache. RewriteCond %{REQUEST_FILENAME} !^.*?\.[^/]{2,5}$
RewriteRule (.*) /index.cfm$1 [PT]
ErrorLog "logs/test-site.log"
</VirtualHost>
> > > Accessinghttp://cold-test.local/testcontrollerbringsupa page with