httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <krist.vanbes...@gmail.com>
Subject Re: [users@httpd] RewriteCond and Rule
Date Tue, 22 Apr 2008 12:18:14 GMT
On Tue, Apr 22, 2008 at 11:57 AM, Emil Edeholt <emil@knmedical.se> wrote:
> Hello!
>
>  I've been trying to make my urls look like site.com/foo instead of
> site.com/index.php?page=foo so I have one rewriterurl that rewrites /foo to
> my php script and one rule that redirects old index.php-url:s to my new
> urls. When I apply both rules they end up in an infinite loop that I just
> can't get to stop. I've tried adding a lot of different conds, but I can't
> get it to work.
>
>  # If the url does not contain index.php rewrite to index.php script
>  RewriteCond %{REQUEST_URI} !index\.php
>  RewriteRule ^([a-z_]*)$ index.php?page=$1 [L]
>
>
>  # If the url does contain index.php redirect to /foo
>  RewriteCond %{REQUEST_URI} index\.php
>  RewriteCond %{QUERY_STRING} page=([a-z_]*)
>  RewriteRule ^index.php$ /base/path/%1? [R=301,L]
>
>  Any ideas?

Switch on rewrite logging. You'll find out more about what is going on.

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


Mime
View raw message