redirect not working
30 posts
• Page 2 of 2 • 1, 2
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect not working
There's smth wrong here - escaping /royal-canin/${mapani:}/1
Please, provide the rule as it is in your file.
Regards
Andrew
Please, provide the rule as it is in your file.
Regards
Andrew
- Translating-IT
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: redirect not working
here it is:
- Code: Select all
RewriteMap mapani txt:mapfileanide.txt
RewriteCond %{HTTP:Host} ^www\.pet-needs\.de$ [NC]
RewriteCond %{REQUEST_URI} ^/index\.asp$ [NC]
RewriteCond %{QUERY_STRING} ^m__id=2&ani=([^&]*)&pag=1 [NC]
RewriteRule ^index\.asp$ /royal-canin/${mapani:$1}/1? [NC,R=301,L]
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect not working
Solved!
there's no $1 variable. Change $1 to %1.
there's no $1 variable. Change $1 to %1.
- Translating-IT
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: redirect not working
Then I get this:
http://www.pet-needs.de/royal-canin//1
http://www.pet-needs.de/royal-canin//1
- Code: Select all
(2) init rewrite engine with requested uri /index.asp?m__id=2&ani=1&pag=1
(1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
(3) applying pattern '^index\.asp$' to uri 'index.asp'
(4) RewriteCond: input='www.pet-needs.de' pattern='^www\.pet-needs\.de$' => matched
(4) RewriteCond: input='/index.asp' pattern='^/index\.asp$' => matched
178.112.243.22 178.112.243.22 Mon, 07-May-2012 12:42:42 GMT [www.pet-needs.de/sid#13][rid#28367848/initial] (4) RewriteCond: input='m__id=2&ani=1&pag=1' pattern='^m__id=2&ani=([^&]*)&pag=1' => matched
(5) map lookup FAILED: map=mapani[txt] key=1
(1) escaping /royal-canin//1
(2) explicitly forcing redirect with http://www.pet-needs.de/royal-canin//1
(2) internal redirect with /index.asp?m__id=2&ani=1&pag=1 [INTERNAL REDIRECT]
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect not working
Here's a problem:
(5) map lookup FAILED: map=mapani[txt] key=1
There's no such entry. Or mapfile wasn't re-read. There's a nice example of a condition for non-existing in FAQ
Regards
Andrew
(5) map lookup FAILED: map=mapani[txt] key=1
There's no such entry. Or mapfile wasn't re-read. There's a nice example of a condition for non-existing in FAQ
Regards
Andrew
- Translating-IT
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: redirect not working
This is the mapani file content, the key definitely exists:
- Code: Select all
katzen 1
hunde 2
frettchen 3
nager 4
voegel 5
aquaristik 6
terraristik 7
pferde 8
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect not working
Try to change places of the entries vice versa. It'll work this way.
Regards
Andrew
Regards
Andrew
- Translating-IT
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: redirect not working
thx, that helped.
now one more question:
is the mapping function also possible for the back writing?
RewriteRule ^royal-canin/katzen/(.*)$ index.asp?m__id=2&ani=1&pag=$1 [L]
now one more question:
is the mapping function also possible for the back writing?
RewriteRule ^royal-canin/katzen/(.*)$ index.asp?m__id=2&ani=1&pag=$1 [L]
- Translating-IT
- Posts: 32
- Joined: 14 Apr 2012, 07:28
Re: redirect not working
Ok, seems I also solved that last question. I only had some errors to be fixed. ( $1 vs %1)
30 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 0 guests