You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Axel-Stéphane SMORGRAV <Ax...@europe.adp.com> on 2005/08/01 09:05:34 UTC

RE: [users@httpd] Re: mod_rewrite issue

I do not think that will match either. I believe you need to include the first /

 RewriteRule ^/([A-Za-z])/$ index.php?object=$1

-----Original Message-----
From: Joost de Heer [mailto:sanguis@xs4all.nl] 
Sent: Friday, July 29, 2005 8:03 PM
To: Thomas
Cc: users@httpd.apache.org
Subject: [users@httpd] Re: mod_rewrite issue

> RewriteEngine on
> RewriteRule ^([A-Za-z])$ /$1/ [R]
> RewriteRule ^([A-Za-z])/$ index.php?object=$1
>
> Now, if I go http://mysite.com/signup/ it does not map it but only 
> displays a 404. What am I missing?

That you match only one character in the regexp, instead of an arbitrary number.

What you need is something like
RewriteRule ^([A-Za-z]+)/$ /index.php?object=$1

Joost


---------------------------------------------------------------------
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] Re: mod_rewrite issue

Posted by Joost de Heer <sa...@xs4all.nl>.
Axel-Stéphane  SMORGRAV said:
> I do not think that will match either. I believe you need to include the
> first /
>
>  RewriteRule ^/([A-Za-z])/$ index.php?object=$1

The rewrite was in a .htaccess, doesn't that mean that the leading / isn't
included? I don't have any experience with rewrites inside a .htaccess, so
I could be wrong....

Joost


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