Apache Server configuration support - Re: mod_rewrite: what exactly is the difference between [R] and not

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > July 2004 > Re: mod_rewrite: what exactly is the difference between [R] and not





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: mod_rewrite: what exactly is the difference between [R] and not
faxe

2004-07-21, 7:57 am

Peter Holm napisał(a):

> Hi,
>
> RewriteCond %{REQUEST_URI} !^/somedir/
> RewriteRule ^(.*)$ http://%{SERVER_NAME}$1 [L]
>
> seems to do the same as
>
> RewriteCond %{REQUEST_URI} !^/somedir/
> RewriteRule ^(.*)$ http://%{SERVER_NAME}$1 [R,L]
>
> My question is: what exactly is the difference with using [R]? I asked
> myself "what exatly is a redirect?" and tried to find out something
> using wget with the site configured with the rules above, but I get an
> 302 redirect no matter if I use [R,L] or [L]
>
> Could anybody please tell me, what exactly is the point with [R]?


[R] should redirect client to rewrited URL:

"redirect|R [=code]' (force redirect)
Prefix Substitution with http://thishost[:thisport]/ (which makes the
new URL a URI) to force a external redirection. If no code is given a
HTTP response of 302 (MOVED TEMPORARILY) is used. If you want to use
other response codes in the range 300-400 just specify them as a number
or use one of the following symbolic names: temp (default), permanent,
seeother. Use it for rules which should canonicalize the URL and give it
back to the client, e.g., translate ``/~'' into ``/u/'' or always append
a slash to /u/user, etc."

http://httpd.apache.org/docs-2.0/mo...tml#rewriterule > Flags

--
Paweł Zdziarski
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com