httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: [users@httpd] mod_rewrite syntax question
Date Tue, 18 Nov 2003 02:42:43 GMT

On Mon, 17 Nov 2003, Eben Goodman wrote:
> the problem is that I can't use a url like -
> without the trailing slash I get a 404 error.  If I take the 6th line:
> RewriteRule ^(.+)/?$ index.php?request=$1 [T=application/x-httpd-php,L]
> and remove the question mark like so:
> RewriteRule ^(.+)/$ index.php?request=$1 [T=application/x-httpd-php,L]
> I can use urls without trailing slashes, but then my style sheets and
> images don't resolve.  I'm still a bit of a novice with the mod_rewrite
> regex syntax, and am a bit baffled by this.  Any advice is appreciated.

I don't precisely understand the details of your problem, but it appears
the basics are: you want to be able to use a URL without a trailing slash,
but you need the trailing slash to make relative references work.

The standard solution to this is to do an external redirect ([R] flag to
rewriterule) to send the client from the bad url to the good url.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message