You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Bakshi" <jo...@infoservices.in> on 2009/11/16 05:27:18 UTC

[users@httpd] RewriteBase is not working in apache configuration file

Hello,

RewriteBase is working perfectly OK in .htaccess but not in apache
configuration file.  Do we need any special syntax to make it working in
apache configuration file ?

Thanks

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
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] RewriteBase is not working in apache configuration file

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Nov 16, 2009 at 8:17 AM, J. Bakshi <jo...@infoservices.in> wrote:
>
> Thanks a lot to clarify it. I was banging my head with it.  Is there any
> alternative to force document root in side <Directory> then ? Actually I
> need to run some experimental sites from a location which is totally
> different from main apache document root.  And my rewritrules try to
> access /var/www as the document root where it should look into
> /var/personal_work_area/

If you have trouble understanding what your RewriteRules do start by
enabling the RewriteLog.
You should understand that in your httpd.conf the RewriteRule will
operate directly on the URL, so it is really immaterial what Docroot
etc... has been set to.
With RewriteRules you can translate URL to filename entirely bypassing
all other directives...

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] RewriteBase is not working in apache configuration file

Posted by "J. Bakshi" <jo...@infoservices.in>.
Krist van Besien wrote:
> On Mon, Nov 16, 2009 at 5:27 AM, J. Bakshi <jo...@infoservices.in> wrote:
>   
>> Hello,
>>
>> RewriteBase is working perfectly OK in .htaccess but not in apache
>> configuration file.  Do we need any special syntax to make it working in
>> apache configuration file ?
>>     
>
> You don't need RewriteBase in your apache configuration file. The
> RewriteBase directive's purpose is to solve a problem caused by the
> fact that URL to Filename translation has allready taken place by the
> time Apache gets to reading your .htaccess file. You don't have this
> problem with RewriteRules in httpd.conf, so there you don't need this
> directive.
>
>
> Krist
>
>   

Hello Krist,

Thanks a lot to clarify it. I was banging my head with it.  Is there any
alternative to force document root in side <Directory> then ? Actually I
need to run some experimental sites from a location which is totally
different from main apache document root.  And my rewritrules try to
access /var/www as the document root where it should look into
/var/personal_work_area/

Once again, thanks for your kind response

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
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] RewriteBase is not working in apache configuration file

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Nov 16, 2009 at 5:27 AM, J. Bakshi <jo...@infoservices.in> wrote:
> Hello,
>
> RewriteBase is working perfectly OK in .htaccess but not in apache
> configuration file.  Do we need any special syntax to make it working in
> apache configuration file ?

You don't need RewriteBase in your apache configuration file. The
RewriteBase directive's purpose is to solve a problem caused by the
fact that URL to Filename translation has allready taken place by the
time Apache gets to reading your .htaccess file. You don't have this
problem with RewriteRules in httpd.conf, so there you don't need this
directive.


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] RewriteBase is not working in apache configuration file

Posted by "J. Bakshi" <jo...@infoservices.in>.
Igor Cicimov wrote:
> What are the rewrite rules you have put in the main config file? Do
> you have "RewriteEngine On" statement first?

Yes, I have the statement already there. Here is my config

````
Alias /personal/joydeep  /var/personal_work_area/joydeep

        <Directory /var/personal_work_area/joydeep/>
        RewriteEngine On
        RewriteBase /personal/joydeep/test
         
           Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
````

and .htaccess ( ilocated at /personal/joydeep/test) is

````
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^alice.html$ bob.html
````

I have checked that RewriteBase is working perfectly when placed in
.htaccess. When I have placed it in apache configuration the sites stops
working as it then trying to access  /var/www





> On Mon, Nov 16, 2009 at 3:27 PM, J. Bakshi <joydeep@infoservices.in
> <ma...@infoservices.in>> wrote:
>
>     Hello,
>
>     RewriteBase is working perfectly OK in .htaccess but not in apache
>     configuration file.  Do we need any special syntax to make it
>     working in
>     apache configuration file ?
>
>     Thanks
>
>     --
>     জয়দীপ বক্সী
>
>
>     ---------------------------------------------------------------------
>     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
>     <ma...@httpd.apache.org>
>       "   from the digest: users-digest-unsubscribe@httpd.apache.org
>     <ma...@httpd.apache.org>
>     For additional commands, e-mail: users-help@httpd.apache.org
>     <ma...@httpd.apache.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] RewriteBase is not working in apache configuration file

Posted by Igor Cicimov <ic...@gmail.com>.
What are the rewrite rules you have put in the main config file? Do you have
"RewriteEngine On" statement first?

On Mon, Nov 16, 2009 at 3:27 PM, J. Bakshi <jo...@infoservices.in> wrote:

> Hello,
>
> RewriteBase is working perfectly OK in .htaccess but not in apache
> configuration file.  Do we need any special syntax to make it working in
> apache configuration file ?
>
> Thanks
>
> --
> জয়দীপ বক্সী
>
>
> ---------------------------------------------------------------------
> 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] Re: RewriteBase is not working in apache configuration file

Posted by "J. Bakshi" <jo...@infoservices.in>.
LuKreme wrote:
> On 15-Nov-2009, at 21:27, J. Bakshi wrote:
>   
>> RewriteBase is working perfectly OK in .htaccess but not in apache
>> configuration file.
>>     
>
> I'm trying to imagine a scenario in which you would need RewriteBase in the apache configuration file. Isn't the point of it to be in .htaccess? I'm almost positive I've never seen it elsewhere.
>
>   

Krist has already clarified it in his post.

-- 
জয়দীপ বক্সী


---------------------------------------------------------------------
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] Re: RewriteBase is not working in apache configuration file

Posted by LuKreme <kr...@kreme.com>.
On 15-Nov-2009, at 21:27, J. Bakshi wrote:
> RewriteBase is working perfectly OK in .htaccess but not in apache
> configuration file.

I'm trying to imagine a scenario in which you would need RewriteBase in the apache configuration file. Isn't the point of it to be in .htaccess? I'm almost positive I've never seen it elsewhere.

-- 
SUBSTITUTE TEACHERS ARE NOT SCABS
	Bart chalkboard Ep. BABF09


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