Hi there,
I've successfully got rewrite rules working for my dynamic site using the following;
.htaccess file in root directory:
RewriteEngine On
RewriteRule ^/?$ /resources/
RewriteRule ^/resources/?$ /resources/
Apache config httpd.conf:
<Directory "/home/myurl/public_html/resources">
Options All -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule (.*) /cgi-bin/page.cgi?g=$1 [L]
AllowOverride All
Allow From All
</Directory>
I'm now trying to do the same for review.cgi and not doing very well. Using code from the forum, I added the following global called review_rewrite;
sub {
my $tags = shift;
my $Title;
$Title .= "$tags->{'Title'}";
$Title =~ y/ \t\r\n?"'#/__/d;
return 'http://www.myurl.com/reviews/' . $Title . '_L' . $tags->{'ID'} . '.html';
}
I then added another .htaccess file into my reviews directory;
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^.*L([0-9]+).*\html$ /cgi-bin/review.cgi?ID=$1&d=1 [L]
I'm now adding a review link in my templates using this;
<a href="<%review_rewrite%>">Read <%Review_Count%> Reviews</a>
Clicking on the link causes the server to give an error 500.
I think the reason is because I've effectively got two rewrite rules in conflict here.
The first one for the main site clashes with the one for the reviews.
Can anybody help me make sense of how to achieve this?
I've successfully got rewrite rules working for my dynamic site using the following;
.htaccess file in root directory:
RewriteEngine On
RewriteRule ^/?$ /resources/
RewriteRule ^/resources/?$ /resources/
Apache config httpd.conf:
<Directory "/home/myurl/public_html/resources">
Options All -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule (.*) /cgi-bin/page.cgi?g=$1 [L]
AllowOverride All
Allow From All
</Directory>
I'm now trying to do the same for review.cgi and not doing very well. Using code from the forum, I added the following global called review_rewrite;
sub {
my $tags = shift;
my $Title;
$Title .= "$tags->{'Title'}";
$Title =~ y/ \t\r\n?"'#/__/d;
return 'http://www.myurl.com/reviews/' . $Title . '_L' . $tags->{'ID'} . '.html';
}
I then added another .htaccess file into my reviews directory;
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^.*L([0-9]+).*\html$ /cgi-bin/review.cgi?ID=$1&d=1 [L]
I'm now adding a review link in my templates using this;
<a href="<%review_rewrite%>">Read <%Review_Count%> Reviews</a>
Clicking on the link causes the server to give an error 500.
I think the reason is because I've effectively got two rewrite rules in conflict here.
The first one for the main site clashes with the one for the reviews.
Can anybody help me make sense of how to achieve this?