You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by thomas Armstrong <ta...@gmail.com> on 2007/12/12 13:18:30 UTC

[users@httpd] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Hi.

I created this .htaccess:
-----
RewriteRule ^([^/]+)/$ /page.php?id=$1 [L]
-------

And it works fine with:
http://domain.com/foo/ (it shows a webpage)

But it shows a 404 error page with:
http://domain.com/foo

I tried adding this line to .htaccess:
----
RewriteRule ^([^/]+)$ /page.php?id=$1 [L]
-----

But now it shows a 500 error webpage in both cases.

Any suggestion? Thank you very much.

---------------------------------------------------------------------
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] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Posted by "Neil A. Hillard" <ne...@agustawestland.com>.
Hi,

thomas Armstrong wrote:
> Hi Eric. Thank you very much for you answer.
> 
> I typed:
> -------------
> RewriteRule ^([^/]+)/*$ /page.php?id=$1 [L]
> -------------
> and got 500 error message on every page on my website. The same with:
> 
> ---------------
> RewriteRule ^([^/]+)/?$ /page.php?id=$1 [L]
> --------------------

So what does error_log have to say about things?


				Neil.


> On Dec 12, 2007 1:31 PM, Eric Covener <co...@gmail.com> wrote:
>> On Dec 12, 2007 7:18 AM, thomas Armstrong <ta...@gmail.com> wrote:
>>> Hi.
>>>
>>> I created this .htaccess:
>>> -----
>>> RewriteRule ^([^/]+)/$ /page.php?id=$1 [L]
>>> -------
>>>
>>> And it works fine with:
>>> http://domain.com/foo/ (it shows a webpage)
>>>
>>> But it shows a 404 error page with:
>>> http://domain.com/foo
>> Looks like ending your pattern in /?$ or /*$ would allow you to throw
>> away 0 or more trailing slashes.


-- 
Neil Hillard                    neil.hillard@agustawestland.com
AgustaWestland                  http://www.whl.co.uk/

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.

---------------------------------------------------------------------
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] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Posted by Jennifer Lynn <je...@gmail.com>.
hi

I thought if you wanted the "foo" and everything underneath it or by itself

RewriteRule ^/foo/?.*$ /landing_page
Jenny

On Dec 12, 2007 9:41 AM, thomas Armstrong <ta...@gmail.com> wrote:

> ---------------
> RewriteRule ^([^/]+)/?$ /page.php?id=$1 [L]
> --------------------
>

Re: [users@httpd] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Posted by Krist van Besien <kr...@gmail.com>.
On Dec 12, 2007 3:41 PM, thomas Armstrong <ta...@gmail.com> wrote:
> Hi Eric. Thank you very much for you answer.
>
> I typed:
> -------------
> RewriteRule ^([^/]+)/*$ /page.php?id=$1 [L]
> -------------
> and got 500 error message on every page on my website. The same with:
>
> ---------------
> RewriteRule ^([^/]+)/?$ /page.php?id=$1 [L]
> --------------------

Ad a RewriteLog with high enough log level. That way you will see how
your URLs are rewritten. If you don't understand something in the log
just post it here.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Posted by thomas Armstrong <ta...@gmail.com>.
Hi Eric. Thank you very much for you answer.

I typed:
-------------
RewriteRule ^([^/]+)/*$ /page.php?id=$1 [L]
-------------
and got 500 error message on every page on my website. The same with:

---------------
RewriteRule ^([^/]+)/?$ /page.php?id=$1 [L]
--------------------

Regards,
--Thomas


On Dec 12, 2007 1:31 PM, Eric Covener <co...@gmail.com> wrote:
> On Dec 12, 2007 7:18 AM, thomas Armstrong <ta...@gmail.com> wrote:
> > Hi.
> >
> > I created this .htaccess:
> > -----
> > RewriteRule ^([^/]+)/$ /page.php?id=$1 [L]
> > -------
> >
> > And it works fine with:
> > http://domain.com/foo/ (it shows a webpage)
> >
> > But it shows a 404 error page with:
> > http://domain.com/foo
>
> Looks like ending your pattern in /?$ or /*$ would allow you to throw
> away 0 or more trailing slashes.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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] 'domain.com/foo' = 404 but 'domain.com/foo/' works fine

Posted by Eric Covener <co...@gmail.com>.
On Dec 12, 2007 7:18 AM, thomas Armstrong <ta...@gmail.com> wrote:
> Hi.
>
> I created this .htaccess:
> -----
> RewriteRule ^([^/]+)/$ /page.php?id=$1 [L]
> -------
>
> And it works fine with:
> http://domain.com/foo/ (it shows a webpage)
>
> But it shows a 404 error page with:
> http://domain.com/foo

Looks like ending your pattern in /?$ or /*$ would allow you to throw
away 0 or more trailing slashes.

-- 
Eric Covener
covener@gmail.com

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