problem with infinite loop
6 posts
• Page 1 of 1
- Translating-IT
-
- Posts: 32
- Joined: 14 Apr 2012, 07:28
problem with infinite loop
Hi,
I use the pro version and have a problem with redirect resulting in an infinite loop.
the problem happens with user friendly url.
given this:
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteRule ^(admin/.+) $1 [NC,L]
RewriteRule ^([^&]*)/([^&]*)/(.*)$ index.asp?m__id=${mapmid2:$1}&ani=${mapani2:$2}&pag=$3 [L]
RewriteRule ^home$ index.asp [L]
if you enter url.com/home it redirects to url.com/index.asp which is ok but if I now add
RewriteRule ^([^&]*)$ index.asp?m__id=${mapmid2:$1} [L]
(the mapping file works for the other rule before) the page cannot be shown and results in an infinite redirect loop error. Why as it should have matched the home rule before and stop the script?
I use the pro version and have a problem with redirect resulting in an infinite loop.
the problem happens with user friendly url.
given this:
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteRule ^(admin/.+) $1 [NC,L]
RewriteRule ^([^&]*)/([^&]*)/(.*)$ index.asp?m__id=${mapmid2:$1}&ani=${mapani2:$2}&pag=$3 [L]
RewriteRule ^home$ index.asp [L]
if you enter url.com/home it redirects to url.com/index.asp which is ok but if I now add
RewriteRule ^([^&]*)$ index.asp?m__id=${mapmid2:$1} [L]
(the mapping file works for the other rule before) the page cannot be shown and results in an infinite redirect loop error. Why as it should have matched the home rule before and stop the script?
Re: problem with infinite loop
Hello,
Please try to change the rule you add like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^&.]+)$ index.asp?m__id=${mapmid2:$1} [L]
Please try to change the rule you add like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^&.]+)$ index.asp?m__id=${mapmid2:$1} [L]
- Translating-IT
-
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: problem with infinite loop
Hi Anton,
Yes, that works. it also appends variables to match url type m__id=64&ani=2&pag=1
with rewrite condition RewriteCond %{QUERY_STRING} ^m__id=([^&]*)&ani=([^&]*)&pag=1 [NC] which is fine but now it does not make the redirect to the user friendly url with
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
which is situated a few row above.![Sad :(](./images/smilies/icon_e_sad.gif)
Yes, that works. it also appends variables to match url type m__id=64&ani=2&pag=1
with rewrite condition RewriteCond %{QUERY_STRING} ^m__id=([^&]*)&ani=([^&]*)&pag=1 [NC] which is fine but now it does not make the redirect to the user friendly url with
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
which is situated a few row above.
![Sad :(](./images/smilies/icon_e_sad.gif)
Re: problem with infinite loop
Hello,
Can you show me the entire config, because there is definitely a cond before this rule:
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
It would be easier to fix it seeing the whole picture.
Can you show me the entire config, because there is definitely a cond before this rule:
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
It would be easier to fix it seeing the whole picture.
- Translating-IT
-
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: problem with infinite loop
Hi Anton,
here we go
here we go
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteMap mapmid txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemid.txt
RewriteMap mapmid2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemidre.txt
RewriteMap mapani txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanide.txt
RewriteMap mapani2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanidere.txt
RewriteMap mapgid txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegidde.txt
RewriteMap mapgid2 txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegiddere.txt
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteCond %{REQUEST_URI} ^/index\.asp$ [NC]
RewriteCond %{QUERY_STRING} ^m__id=([^&]*)&ani=([^&]*)&pag=1 [NC]
RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^gid=([^&]*) [NC]
#RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
#RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
#RewriteRule ^index\.asp$ /${mapgid:%1}? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^m__id=([^&]*) [NC]
#RewriteRule ^index\.asp$ /${mapmid:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteRule ^(admin/.+) $1 [NC,L]
RewriteRule ^([^&]*)/([^&]*)/(.*)$ index.asp?m__id=${mapmid2:$1}&ani=${mapani2:$2}&pag=$3 [L]
RewriteRule ^home$ index.asp [L]
#RewriteRule ^([^&]*)$ index.asp?gid=${mapgid2:$1} [L]
RewriteRule ^([^&.]+)$ index.asp?m__id=${mapmid2:$1}&ani=1&pag=1 [L]
Re: problem with infinite loop
Hello,
Please try to fix your config like this:
RewriteEngine on
RewriteBase /
RewriteMap mapmid txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemid.txt
RewriteMap mapmid2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemidre.txt
RewriteMap mapani txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanide.txt
RewriteMap mapani2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanidere.txt
RewriteMap mapgid txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegidde.txt
RewriteMap mapgid2 txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegiddere.txt
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteCond %{REQUEST_URI} ^/index\.asp$ [NC]
RewriteCond %{QUERY_STRING} ^m__id=([^&]*)&ani=([^&]*)&pag=1 [NC]
RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^gid=([^&]*) [NC]
#RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
#RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
#RewriteRule ^index\.asp$ /${mapgid:%1}? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^m__id=([^&]*) [NC]
#RewriteRule ^index\.asp$ /${mapmid:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteRule ^(admin/.+) $1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^&./]+)/([^&/.]+)/(.*)$ index.asp?m__id=${mapmid2:$1}&ani=${mapani2:$2}&pag=$3 [L]
RewriteRule ^home$ index.asp [L]
#RewriteRule ^([^&./]+)$ index.asp?gid=${mapgid2:$1} [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/&.]+)$ index.asp?m__id=${mapmid2:$1}&ani=1&pag=1 [L]
Please try to fix your config like this:
RewriteEngine on
RewriteBase /
RewriteMap mapmid txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemid.txt
RewriteMap mapmid2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfilemidre.txt
RewriteMap mapani txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanide.txt
RewriteMap mapani2 txt:C:/Program Files/Helicon/ISAPI_Rewrite3/mapfileanidere.txt
RewriteMap mapgid txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegidde.txt
RewriteMap mapgid2 txt:D:/var/www/root_zotto/pet-needs.de/wwwroot/Admin/mapfilegiddere.txt
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteCond %{REQUEST_URI} ^/index\.asp$ [NC]
RewriteCond %{QUERY_STRING} ^m__id=([^&]*)&ani=([^&]*)&pag=1 [NC]
RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
RewriteRule ^index\.asp$ /${mapmid:%1}/${mapani:%2}/1? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^gid=([^&]*) [NC]
#RewriteCond ${mapmid:${lower:%1}|NOT_FOUND} !NOT_FOUND
#RewriteCond ${mapani:${lower:%2}|NOT_FOUND} !NOT_FOUND
#RewriteRule ^index\.asp$ /${mapgid:%1}? [NC,R=301,L]
#RewriteCond %{QUERY_STRING} ^m__id=([^&]*) [NC]
#RewriteRule ^index\.asp$ /${mapmid:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteRule ^(admin/.+) $1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^&./]+)/([^&/.]+)/(.*)$ index.asp?m__id=${mapmid2:$1}&ani=${mapani2:$2}&pag=$3 [L]
RewriteRule ^home$ index.asp [L]
#RewriteRule ^([^&./]+)$ index.asp?gid=${mapgid2:$1} [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/&.]+)$ index.asp?m__id=${mapmid2:$1}&ani=1&pag=1 [L]
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 18 guests