Google Answers Logo
View Question
 
Q: mod_rewrite ( No Answer,   0 Comments )
Question  
Subject: mod_rewrite
Category: Computers > Internet
Asked by: eqs-ga
List Price: $20.00
Posted: 12 Nov 2002 10:33 PST
Expires: 12 Dec 2002 10:33 PST
Question ID: 106181
This is my second question in this area, the first answer I received
was very helpful but led to this one.

I am utilizing mod_rewrite in Apache on a Slackware box.  I am writing
the Rewrite rules directly into the httpd.conf file.  I have several
dozen rules, most of which work.  The ones that work redirect to an
ugly database search path, e.g.:

RewriteRule /fujitsu_scanners/
http://1st-in-scanners.com/cgi-bin/webdata/webdata_pro.pl?_cgifunction=search&_layout=manufacturer&manufacturers.manufacturer_id=1

But one that I thought would be simple,

Rewrite Rule /ordering/ http://www.1st-in-scanners.com/ordering.html

produces weird results.  I'm getting the page content twice.  This
does not happen when I go directly to the target location, only when I
use the rewrite address.  The page in question utilizes SSI to produce
the header and footer of the page.  One of the developers in my office
suggested that maybe this is the source of the problem but when I
commented out the header include I still got the double content--it
just didn't include the header, it still included double content.

My question is two-fold:  What is causing this and how do I resolve
it?

Request for Question Clarification by sgtcory-ga on 12 Nov 2002 11:08 PST
Can you post some of your rewrites? (block out any important path info
etc..)

I was trying to view the sites, but could not get repeatability
because you altered the page as I was looking :-) Thanks -

SgtCory

Clarification of Question by eqs-ga on 12 Nov 2002 13:20 PST
The rewrites I included in the original question are one that works
(/fujitsu_scanners/) and the one that doesn't (/ordering/ which goes
to www.1st-in-scanners.com/ordering.html).

I'll stop modifying them for a while so you can look at them. ;)

--EQS

Request for Question Clarification by sgtcory-ga on 12 Nov 2002 14:59 PST
Hello again,

I am not trying to insult your intelligence, just making sure we have
dotted our 'i's ...

Have you enabled server side includes for HTML pages? I am unable to
tell because the first page is linked to your cgi-bin.

In the /ordering/ directory, you may have an .htaccess file with the
following:

AddHandler server-parsed .html

If not, do you have this in your httpd.conf? If you don't have this -
create a file called .htaccess (with the dot), and add the line above.
Save the file and add it to the ordering directory and let me know
what happens.

If you do have this handler type, then I can go to the next step.

Thanks for the clarification -
SgtCory

Request for Question Clarification by sgtcory-ga on 12 Nov 2002 15:19 PST
It would seem like you would have it already if your static html page
was being parsed, but the only reason I asked was because I saw this
in your HTML from the current rewritten directory :

<TD ALIGN="CENTER" COLSPAN="2">
[an error occurred while processing this directive]
</TD>

Thanks again
SgtCory

Request for Question Clarification by majortom-ga on 12 Nov 2002 15:40 PST
I was not able to reproduce the problem using Apache 1.3.22.

Please post the version of Apache you are using. If you are
not 100% sure, you can test this:

/usr/local/apache/bin/httpd -v (depending on the install
location on your particular server)

Clarification of Question by eqs-ga on 12 Nov 2002 18:52 PST
It turns out the problem was related to the relative path of the
second SSI include in the document and was only marginally related to
the mod_rewrite issue (it introduced the relative path issues which
did not previously exist).

Thank you for your suggestions.  I am sure that if this had been a
direct mod_rewrite problem you would have resolved it.

--EQS
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy