Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Rules for mod_rewrite?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sean Walsh  
View profile  
 More options Dec 3 2011, 4:04 pm
From: Sean Walsh <sean.wals...@gmail.com>
Date: Sat, 3 Dec 2011 13:04:53 -0800 (PST)
Local: Sat, Dec 3 2011 4:04 pm
Subject: Rules for mod_rewrite?
I'd like to access my ColdMVC application at http://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]

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sean Walsh  
View profile  
 More options Dec 3 2011, 4:09 pm
From: Sean Walsh <sean.wals...@gmail.com>
Date: Sat, 3 Dec 2011 13:09:03 -0800 (PST)
Local: Sat, Dec 3 2011 4:09 pm
Subject: Re: Rules for mod_rewrite?
Ok, cancel that. Here are my updated Apache settings, which appear to
work:

<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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Ricard  
View profile  
 More options Dec 6 2011, 11:57 am
From: Ryan Ricard <ryan.ric...@gmail.com>
Date: Tue, 6 Dec 2011 08:57:24 -0800 (PST)
Local: Tues, Dec 6 2011 11:57 am
Subject: Re: Rules for mod_rewrite?
Hey Sean,

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

On Dec 3, 3:09 pm, Sean Walsh <sean.wals...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Ricard  
View profile  
 More options Dec 6 2011, 11:59 am
From: Ryan Ricard <ryan.ric...@gmail.com>
Date: Tue, 6 Dec 2011 08:59:42 -0800 (PST)
Local: Tues, Dec 6 2011 11:59 am
Subject: Re: Rules for mod_rewrite?
Let's try this again :)

<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>

On Dec 6, 10:57 am, Ryan Ricard <ryan.ric...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »