You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Kailash Vyas <ka...@gmail.com> on 2007/01/31 11:57:23 UTC
[users@httpd] rewrite rule problem
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
Thanks,
Kailash
Spainhomes.org
http://www.spainhomes.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] rewrite rule problem
Posted by Krist van Besien <kr...@gmail.com>.
On 1/31/07, Kailash Vyas <ka...@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
Re: [users@httpd] Upgrade Question
Posted by Sander Temme <sc...@apache.org>.
On Jan 31, 2007, at 7:49 AM, Bob Cohen wrote:
> I need to upgrade two servers to 2.2.x, one is running 2.0.49
http://httpd.apache.org/docs/2.2/upgrading.html
> the other 1.3.29.
http://httpd.apache.org/docs/2.0/upgrading.html
> Will I be able to use the httpd.conf files from the original server
> configurations or will I have to do those from scratch?
Largely, yes. See the above for instructions. As someone suggests,
start by just firing up a test server (you have a test server, don't
you? You can install one on your desktop if necessary) and see what
bombs.
> Also what other issues do I have to deal with to make the
> transition smooth?
Should be fairly straightforward.
S.
--
sctemme@apache.org http://www.temme.net/sander/
Open Source Software Consultant
PGP FP: 51B4 8727 466A 0BC3 69F4 B7B8 B2BE BC40 1529 24AF
Re: [users@httpd] Upgrade Question
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Bob Cohen wrote:
> I need to upgrade two servers to 2.2.x, one is running 2.0.49 the other
> 1.3.29. Will I be able to use the httpd.conf files from the original
> server configurations or will I have to do those from scratch? Also
> what other issues do I have to deal with to make the transition smooth?
The answer to both is to see the httpd docs. Several directive names
have changes, some modules have split functionality (e.g. cache split from
proxy, cache split into a provider and protocol module). Migrating your
config quite probably better than building a config from the ground up.
---------------------------------------------------------------------
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] Upgrade Question
Posted by Bob Cohen <bo...@mojotools.com>.
On Jan 31, 2007, at 10:56 AM, Gerard wrote:
> Bob Cohen wrote:
>
> What OS are you employing?
Oh sorry RedHat 7.3
---------------------------------------------------------------------
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] Upgrade Question
Posted by Gerard <ge...@seibercom.net>.
Bob Cohen wrote:
> I need to upgrade two servers to 2.2.x, one is running 2.0.49 the
> other 1.3.29. Will I be able to use the httpd.conf files from the
> original server configurations or will I have to do those from
> scratch? Also what other issues do I have to deal with to make the
> transition smooth?
What OS are you employing?
--
Gerard
---------------------------------------------------------------------
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
[users@httpd] Upgrade Question
Posted by Bob Cohen <bo...@mojotools.com>.
I need to upgrade two servers to 2.2.x, one is running 2.0.49 the
other 1.3.29. Will I be able to use the httpd.conf files from the
original server configurations or will I have to do those from
scratch? Also what other issues do I have to deal with to make the
transition smooth?
Bob Cohen
Principal, MojoTools Web Design
Blues Harmonica Lessons
Web : www.mojotools.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