Assuming you meant that the redirect in the post #13 (just above yours) is the one you've settled on... We will add 3 lines in front of the previous code.
This says:Code:RewriteEngine On RewriteCond %{REQUEST_URI} ^/gallery2/main.php$ [NC] RewriteCond %{QUERY_STRING} !^g2_item(.*)$ RewriteRule ^(.*) http://mysite.com/gallery2/index.php/? [L,R=301] RewriteRule ^main\.php(.*)$ index.php/g2/map?path=main.php [QSA,L]
IF the request_uri is main.php (case independent) AND the query_string does not start with "g2_item"
THEN externally redirect to index.php/, erase any query string, return status 301, stop processing any more rules.
ELSE (same as previously)
IF the request_uri is for main.php
THEN internally redirect to index.php/g2/map?path=main.php, append the original query string, stop processing any more rules.
I don't have the ability to test this right now, but I THINK that this will work for what you've just asked.
Mod_rewrite can be tricky, so please test all the conditions, including "www." prefix, g2 and non-g2 query strings and blank query strings


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks