You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Eoin Coffey <ec...@gmail.com> on 2006/08/25 02:14:55 UTC

[users@httpd] mod_rewrite question

Hey There,

After reading the faq, docs, and browsing the usenet I'm still stumped.

Here's the setup.

My work is using port based virtual servers to manage our dev projects.  So
same IP address, but it will server up a different docroot depending on the
port number.

I've put the 'RewriteEngine on' in the relevant <VirtualHost> directive.  I
also created a simple .htaccess file in the docroot with:

'RewriteEngine on

RewriteBase /

RewriteRule ^yarg\.php$ index.php'

But /yarg.php still gives me a 404 error.

As a sidenote I also added 'RewriteLog rewrite_log' and 'RewriteLogLevel 9'
to .htaccess, but the log file is not created, which makes me suspect the
rewrite engine doesn't even kick in.

We're running Apache 2.2.0 on a Fedora Core box.

I've verified that mod_rewrite is loaded with get_apache_modules().

A pre-thanks for the help, and a apology for any lack of information or
confusion on my part.

-Eoin

Re: [users@httpd] mod_rewrite question

Posted by Eoin Coffey <ec...@gmail.com>.
...right.  well in any event I have it working now.

Thanks for the help :-)

-Eoin


On 8/24/06, Joshua Slive <jo...@slive.ca> wrote:
>
> On 8/24/06, Eoin Coffey <ec...@gmail.com> wrote:
> > Removed the .htaccess file and added the two lines to the <VirtualHost>
> > directive.
> >
> > Instead of a 404 error I get a 400 error now.
> >
> > -Eoin
> >
> >
> > On 8/24/06, Joshua Slive <jo...@slive.ca> wrote:
> > >
> > On 8/24/06, Eoin Coffey < ecoffey@gmail.com> wrote:
> > > Hey There,
> > >
> > > After reading the faq, docs, and browsing the usenet I'm still
> stumped.
> > >
> > > Here's the setup.
> > >
> > > My work is using port based virtual servers to manage our dev
> projects.
> > So
> > > same IP address, but it will server up a different docroot depending
> on
> > the
> > > port number.
> > >
> > > I've put the 'RewriteEngine on' in the relevant <VirtualHost>
> directive.
> > I
> > > also created a simple .htaccess file in the docroot with:
> > >
> > > 'RewriteEngine on
> > >
> > > RewriteBase /
> > >
> > > RewriteRule ^yarg\.php$ index.php'
> > >
> > > But /yarg.php still gives me a 404 error.
> > >
> > > As a sidenote I also added 'RewriteLog rewrite_log' and
> 'RewriteLogLevel
> > 9'
> > > to .htaccess, but the log file is not created, which makes me suspect
> the
> > > rewrite engine doesn't even kick in.
> > >
> > > We're running Apache 2.2.0 on a Fedora Core box.
> > >
> > > I've verified that mod_rewrite is loaded with get_apache_modules().
> > >
> > > A pre-thanks for the help, and a apology for any lack of information
> or
> > > confusion on my part.
> >
> > RewriteLog isn't even allowed in .htaccess files.  So this tells me
> > you have AllowOverride set to prevent apache from reading .htaccess
> > files.
> >
> > But don't fix that.  Just put the RewriteRules in httpd.conf where they
> > belong:
> > RewriteEngine On
> > RewriteRule ^/yarg\.php$ index.php'
>
> Should be
> RewriteRule ^/yarg\.php$ /index.php
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] mod_rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On 8/24/06, Eoin Coffey <ec...@gmail.com> wrote:
> Removed the .htaccess file and added the two lines to the <VirtualHost>
> directive.
>
> Instead of a 404 error I get a 400 error now.
>
> -Eoin
>
>
> On 8/24/06, Joshua Slive <jo...@slive.ca> wrote:
> >
> On 8/24/06, Eoin Coffey < ecoffey@gmail.com> wrote:
> > Hey There,
> >
> > After reading the faq, docs, and browsing the usenet I'm still stumped.
> >
> > Here's the setup.
> >
> > My work is using port based virtual servers to manage our dev projects.
> So
> > same IP address, but it will server up a different docroot depending on
> the
> > port number.
> >
> > I've put the 'RewriteEngine on' in the relevant <VirtualHost> directive.
> I
> > also created a simple .htaccess file in the docroot with:
> >
> > 'RewriteEngine on
> >
> > RewriteBase /
> >
> > RewriteRule ^yarg\.php$ index.php'
> >
> > But /yarg.php still gives me a 404 error.
> >
> > As a sidenote I also added 'RewriteLog rewrite_log' and 'RewriteLogLevel
> 9'
> > to .htaccess, but the log file is not created, which makes me suspect the
> > rewrite engine doesn't even kick in.
> >
> > We're running Apache 2.2.0 on a Fedora Core box.
> >
> > I've verified that mod_rewrite is loaded with get_apache_modules().
> >
> > A pre-thanks for the help, and a apology for any lack of information or
> > confusion on my part.
>
> RewriteLog isn't even allowed in .htaccess files.  So this tells me
> you have AllowOverride set to prevent apache from reading .htaccess
> files.
>
> But don't fix that.  Just put the RewriteRules in httpd.conf where they
> belong:
> RewriteEngine On
> RewriteRule ^/yarg\.php$ index.php'

Should be
RewriteRule ^/yarg\.php$ /index.php

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite question

Posted by Eoin Coffey <ec...@gmail.com>.
Removed the .htaccess file and added the two lines to the <VirtualHost>
directive.

Instead of a 404 error I get a 400 error now.

-Eoin

On 8/24/06, Joshua Slive <jo...@slive.ca> wrote:
>
> On 8/24/06, Eoin Coffey <ec...@gmail.com> wrote:
> > Hey There,
> >
> > After reading the faq, docs, and browsing the usenet I'm still stumped.
> >
> > Here's the setup.
> >
> > My work is using port based virtual servers to manage our dev
> projects.  So
> > same IP address, but it will server up a different docroot depending on
> the
> > port number.
> >
> > I've put the 'RewriteEngine on' in the relevant <VirtualHost>
> directive.  I
> > also created a simple .htaccess file in the docroot with:
> >
> > 'RewriteEngine on
> >
> > RewriteBase /
> >
> > RewriteRule ^yarg\.php$ index.php'
> >
> > But /yarg.php still gives me a 404 error.
> >
> > As a sidenote I also added 'RewriteLog rewrite_log' and 'RewriteLogLevel
> 9'
> > to .htaccess, but the log file is not created, which makes me suspect
> the
> > rewrite engine doesn't even kick in.
> >
> > We're running Apache 2.2.0 on a Fedora Core box.
> >
> > I've verified that mod_rewrite is loaded with get_apache_modules().
> >
> > A pre-thanks for the help, and a apology for any lack of information or
> > confusion on my part.
>
> RewriteLog isn't even allowed in .htaccess files.  So this tells me
> you have AllowOverride set to prevent apache from reading .htaccess
> files.
>
> But don't fix that.  Just put the RewriteRules in httpd.conf where they
> belong:
> RewriteEngine On
> RewriteRule ^/yarg\.php$ index.php'
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] mod_rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On 8/24/06, Eoin Coffey <ec...@gmail.com> wrote:
> Hey There,
>
> After reading the faq, docs, and browsing the usenet I'm still stumped.
>
> Here's the setup.
>
> My work is using port based virtual servers to manage our dev projects.  So
> same IP address, but it will server up a different docroot depending on the
> port number.
>
> I've put the 'RewriteEngine on' in the relevant <VirtualHost> directive.  I
> also created a simple .htaccess file in the docroot with:
>
> 'RewriteEngine on
>
> RewriteBase /
>
> RewriteRule ^yarg\.php$ index.php'
>
> But /yarg.php still gives me a 404 error.
>
> As a sidenote I also added 'RewriteLog rewrite_log' and 'RewriteLogLevel 9'
> to .htaccess, but the log file is not created, which makes me suspect the
> rewrite engine doesn't even kick in.
>
> We're running Apache 2.2.0 on a Fedora Core box.
>
> I've verified that mod_rewrite is loaded with get_apache_modules().
>
> A pre-thanks for the help, and a apology for any lack of information or
> confusion on my part.

RewriteLog isn't even allowed in .htaccess files.  So this tells me
you have AllowOverride set to prevent apache from reading .htaccess
files.

But don't fix that.  Just put the RewriteRules in httpd.conf where they belong:
RewriteEngine On
RewriteRule ^/yarg\.php$ index.php'

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org