Forum Moderators: phranque
In my .htaccess file i have a set of rules like this one like
RewriteRule ^([^/]+)/([^/]+)/hotels/([^-]+)-([^-]+)\.htm$ some_folder/php_page.php?var1=$1&var2=$2&var3=$3&tvar4=$4 [NC,L]
and another set of rules like
RedirectPermanent /folder1/folder2/hotels/name1-hotel.htm [mysite.com...]
a) if i have only php pages in site, first rules works ok
b) if i have only htm pages in site, second rules works fine
c) when i combie the two rules (meaning i have php and htm files in site, I face a problem...
from second rules i get the correct page but in the following format..
[mysite.com...]
It seems as thought the two rules are merged into one.. the part up to .htm (comes from second rule) its correct), while the part after?var1= (comes from firest rule) is also correct, but I dont want it to appear on url.
This problem comes when i try to use second rule in pages that "dont exist" (they are created by the first rule). I am in the proccess of changing a static site into a dynamic one.
Any advice?
Re-code the Redirect directive as a RewriteRule, use the [L] flag, and place it before the internal rewrite rule.
Jim
Temp solution i got (and working) is by making seperate htaccess files in specific folders with full set of creation/redirection rules.
I understand that this method overloads the server, but it will have to do for 2-3 months untill site is fully dynamic and there is no need to redirect "illusionary" pages anymore
Thanks again for advice