httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Bowman <>
Subject [users@httpd] Re: users Digest 27 Jun 2006 11:29:42 -0000 Issue 2505
Date Tue, 27 Jun 2006 14:19:48 GMT

On Jun 27, 2006, at 7:29 AM, wrote:

> I have the following line in my httpd.conf file:
> ScriptAlias  /cgi-bin/ /var/www/vhosts/site/cgi-bin/
> And the following two rules in .htaccess:
> RewriteRule ^random/miva(.*)$ /mm5/merchant.mvc$1 [R=301]
> RewriteRule ^cgi-bin/miva(.*)$ /mm5/merchant.mvc$1 [R=301]
> The first rule properly rewrites when browsing to site/random/miva?
> directives=here&more=here, while the second rule refuses to rewrite.
> I've had a terrible time finding much reliable information on the
> issue, I've found one website that  claims mod_rewrite will not work
> on a directory that is a scriptalias, because scriptalias is a
> 'deeper' apache module, and therefor takes precedence  before
> mod_rewrite will kick in. My personal experience on this leads me to
> believe this could be true, but since I was only able to find the
> information on one site, with nothing to back it up, I figured i'd
> see what you guys had to say about that.
> Thanks in advance for your time.
> -Brad Bowman
> Where is the .htaccess located?  In the DocumentRoot or in the cgi-bin
> directory?
> The easiest fix for this would be to put the RewriteRule's in the
> httpd.conf instead of in .htaccess (with appropriate path
> adjustments).
> Joshua.

Previously the .htaccess file was in the document root, which I  
assume is probably a mistake. This morning I came in and tried moving  
the .htaccess file into the scriptalias'd cgi-bin, the contents of  
that file read:
         RewriteEngine on
         RewriteRule ^cgi-bin/miva(.*)$ /mm5/merchant.mvc$1 [R=301]

After that failed to work, I attempted to move it into the httpd  
include file that defines the virtualhost for this server, which  
although was not rewriting the way I had hoped, was at least applying  
the rewrite rules to the URI. Which leads me to this question, Is  
mod_rewrite capable of rewriting the query string portion of the url?  
The end result of what i'm hoping to do here is rewrite URI's in the  

is that going to be possible? I've got my RewriteLogLevel at 7, and  
it seems to only include the URL in the rewrite schemes, which made  
me realize i've never actually tried a rewrite on the ${QUERY_STRING}  
portion of a URI.

Thanks again,
View raw message