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] rewrite rule problem
Date Wed, 31 Jan 2007 16:00:29 GMT
On 1/31/07, Kailash Vyas <kailash.vyas@gmail.com> wrote:
> Hi
>
> I need some help regarding rewrite rule.
>
> for example http://example.com/kailash/test should redirect to
> http://example.com/test?name=kailash
>
> I have written this rule for redirection
>
> RewriteRule   ^([^/]+)/([^/]+)/?$    http://example.com/$2?name=$1
>
> This works fine but if the url is http://example.com/kailash then it
> should go to http://example.com/test?name=kailash. for this i wrote
> another rule which does not work
>
> All the requests not matching the above pattern i had written to goto
> test i even tried changing the pattern condition to simple one like
> !^/kailash etc but  the pattern doesn not seem to match
>
> RewriteCond   %{REQUEST_URI}  !^([^/]+)/([^/]+)/?$
> RewriteRule ^(.*)$  http://example.com/test?name=$1
>
> let me know what i might be doing wrong

You might start by adding a rewritelog with a suffficiently high
rewriteloglevel to your config. That way you can see what rules are
tried.

Krist

-- 
krist.vanbesien@gmail.com
Bremgarten b. Bern, Switzerland
--
"...what you don't realize is that in the future Google WILL reach
sentience, will [have had] invent[ed] a time machine, and will [have
had] travel[ed] back in time to prevent Bill Gates... only to become
Bill Gates by accident because of a search engine optimization
miscalculation." (Comment on the Dilbert Blog)

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