Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

RewriteBase is not working in apache configuration file

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


joydeep at infoservices

Nov 15, 2009, 8:27 PM

Post #1 of 8 (652 views)
Permalink
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


icicimov at gmail

Nov 15, 2009, 10:41 PM

Post #2 of 8 (627 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

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 <joydeep [at] infoservices> 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 [at] httpd
> " from the digest: users-digest-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>
>


joydeep at infoservices

Nov 15, 2009, 10:54 PM

Post #3 of 8 (637 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

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 [at] infoservices
> <mailto:joydeep [at] infoservices>> 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 [at] httpd
> <mailto:users-unsubscribe [at] httpd>
> " from the digest: users-digest-unsubscribe [at] httpd
> <mailto:users-digest-unsubscribe [at] httpd>
> For additional commands, e-mail: users-help [at] httpd
> <mailto:users-help [at] httpd>
>
>


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


---------------------------------------------------------------------
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


krist.vanbesien at gmail

Nov 15, 2009, 11:06 PM

Post #4 of 8 (631 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

On Mon, Nov 16, 2009 at 5:27 AM, J. Bakshi <joydeep [at] infoservices> 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 [at] gmail
krist [at] vanbesien
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joydeep at infoservices

Nov 15, 2009, 11:17 PM

Post #5 of 8 (633 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

Krist van Besien wrote:
> On Mon, Nov 16, 2009 at 5:27 AM, J. Bakshi <joydeep [at] infoservices> 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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


kremels at kreme

Nov 16, 2009, 12:06 AM

Post #6 of 8 (638 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joydeep at infoservices

Nov 16, 2009, 12:52 AM

Post #7 of 8 (631 views)
Permalink
Re: Re: RewriteBase is not working in apache configuration file [In reply to]

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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


krist.vanbesien at gmail

Nov 16, 2009, 5:08 AM

Post #8 of 8 (623 views)
Permalink
Re: RewriteBase is not working in apache configuration file [In reply to]

On Mon, Nov 16, 2009 at 8:17 AM, J. Bakshi <joydeep [at] infoservices> 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 [at] gmail
krist [at] vanbesien
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 [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.