Forum Moderators: phranque

Message Too Old, No Replies

querystring to identically named files

querystring to pull in identically named files

         

matc

11:35 am on Apr 26, 2004 (gmt 0)

10+ Year Member



Hello all,

I've got a lovely .htaccess rewrite rule to apply the result/name of a querystring to a identically named include that needs to be bought in. The problem I have is that its not really working yet. Can anyone help me fix my code to work. Many thanks.

My .htaccess file looks like this:
# rewrite on
RewriteEngine On
# a default for page values
#RewriteRule (.*) - [e=loc:default]
# a reg exps on the query string to see if any variables need to be overridden
RewriteCond %{QUERY_STRING} loc=([^&]+)
RewriteRule (.*) - [e=loc:%1]

And the in page code looks like this:
<!-- if the QS is empty apply text -->
<!--#if expr="\"$QUERY_STRING\" = \"\"" -->
<tr>
<td colspan="4"><div style="padding:10px;">
Sorry, this information cannot be displayed. Please return to the <a href="/" class="index">Index page</a>.<br /></div></td>
</tr><!--#else --><tr>
<!-- else bring in set var values for title and graphic -->
<!--#include virtual="/$QUERY_STRING.sssi" -->
<td valign="top"><img src="/f/t.gif" width="10" height="1" alt="" border="0" /></td>
<td width="140" valign="top"><img src="/images/zone<!--#echo var="locmap" -->.gif" width="101" height="101" alt="" border="0" /></td>
<td width="343"><p class="darkblue"><b><!--#echo var="loctitle" --></b></p>
<!-- and main data feed -->
<!--#include virtual="/includes/ca_iw16_$QUERY_STRING.sssi" --><br />
<p><a class="darkgreen" href="/">See more</a></b></p></td>
<td valign="top"><img src="/f/t.gif" width="10" height="1" alt="" border="0" /></td>
</tr><!--#endif --><tr>

Many thanks for any help offered.

ject

jdMorgan

3:15 pm on Apr 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ject,

Can you be a bit more specific about the problem? I've looked at this thread several times, but I can't tell what problem you might be having. The usual approach to a problem like this is to break it down into smaller pieces by trying a series of simplified tests, such as testing the output of the mod_rewrite code by (temporarily) changing it to do an external redirect, which makes its output visible in your browser address bar, then substituting fixed values to be tested by the SSI code, etc.

Jim