You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Malka Cymbalista <Ma...@weizmann.ac.il> on 2008/06/05 11:09:40 UTC

[users@httpd] RewriteEngine directive

If I want to put Rewrite directives into specific <Directory> sections, do I have to put the RewriteEngine directive into each of the sections or can I put it somewhere else in the configuration file where I will not have to repeat it in each directory section.
Thanks for any help.
-- 

Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@weizmann.ac.il
08-934-3036



---------------------------------------------------------------------
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] RewriteEngine directive

Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Jun 5, 2008 at 3:40 PM, Malka Cymbalista
<Ma...@weizmann.ac.il> wrote:
> Thanks for your reply.  I actually read the documentation which is where I learned that I can put Rewrite directives in the directory section.  My question is if there is any way to get around putting
> RewriteEngine on
> in each directory section.  I have   RewriteEngine on   in the config file outside  the directory section but this did not seem to be enough and I had to put it into the specific directory section.

You probably put RewriteEngine on outside your virtual host, which is
indeed not inherited by this virtual host. You need to put it inside
the virtualhost. If you want to swithc it on in a directory section
you don't need to put it in each directory section. Directory sections
are merged, so you could conceivably put it in the root Directory
section. (I don't think it is usually a good idea to put rewritrules
in a directory context...)

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


Re: [users@httpd] RewriteEngine directive

Posted by Malka Cymbalista <Ma...@weizmann.ac.il>.
Thanks for your reply.  I actually read the documentation which is where I learned that I can put Rewrite directives in the directory section.  My question is if there is any way to get around putting   
RewriteEngine on
in each directory section.  I have   RewriteEngine on   in the config file outside  the directory section but this did not seem to be enough and I had to put it into the specific directory section.

-- 

Malka Cymbalista
Webmaster, Weizmann Institute of Science
malki.cymbalista@weizmann.ac.il
08-934-3036


>>> On 6/5/2008 at 4:21 PM, in message
<6e...@mail.gmail.com>, "Krist van
Besien" <kr...@gmail.com> wrote:
> On Thu, Jun 5, 2008 at 11:09 AM, Malka Cymbalista
> <Ma...@weizmann.ac.il> wrote:
>> If I want to put Rewrite directives into specific <Directory> sections, do I 
> have to put the RewriteEngine directive into each of the sections or can I 
> put it somewhere else in the configuration file where I will not have to 
> repeat it in each directory section.
>> Thanks for any help.
> 
> In the documentation
> (http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteengine)
> it says, for RewriteEngine:
> 
> "Context:	server config, virtual host, directory, .htaccess"
> 
> So you can put it in your server config or virtual host.
> 
> General hint: If you are not sure where you can use a directive,
> consult the apache documentation.
> 
> Krist


---------------------------------------------------------------------
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] RewriteEngine directive

Posted by Krist van Besien <kr...@gmail.com>.
On Thu, Jun 5, 2008 at 11:09 AM, Malka Cymbalista
<Ma...@weizmann.ac.il> wrote:
> If I want to put Rewrite directives into specific <Directory> sections, do I have to put the RewriteEngine directive into each of the sections or can I put it somewhere else in the configuration file where I will not have to repeat it in each directory section.
> Thanks for any help.

In the documentation
(http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteengine)
it says, for RewriteEngine:

"Context:	server config, virtual host, directory, .htaccess"

So you can put it in your server config or virtual host.

General hint: If you are not sure where you can use a directive,
consult the apache documentation.

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