Topic: Rewrite rule not working
|

|
| Author |
|
rhjeffreys Newbie

Joined: 21 October 2011 Location: Canada
Online Status: Offline Posts: 1
|
| Posted: 11 November 2011 at 10:14am | IP Logged
|
|
|
Sorry if this has been asked already, but I can't find anything that seems to be similar.
I am trying to add a simple rewrite rule to my site such that any URL that is formatted as www.mysite.com/french/default.aspx?id=1234 is redone as www.mysite.com/french/SubDir/default.aspx?id=1234
But it isn't working, I am getting the following in the Rewrite.log:
10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (1) [perdir d:\westlund\] init rewrite engine with /FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (5) [perdir d:\westlund\] strip matching prefix: /FRENCH/default.aspx -> FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (3) [perdir d:\westlund\] applying pattern ^/FRENCH/default.aspx$ to uri FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (5) [perdir d:\westlund\] strip matching prefix: /FRENCH/default.aspx -> FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (3) [perdir d:\westlund\] applying pattern .? to uri FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (4) [perdir d:\westlund\] RewriteCond: input='/FRENCH/default.aspx' pattern='.*WESTLUND_HQG.*' => not-matched 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (5) [perdir d:\westlund\] strip matching prefix: /FRENCH/default.aspx -> FRENCH/default.aspx 10.161.2.153 10.161.2.153 [11/Nov/2011:11:11:46] [www.westlundpvf.com/sid#271790843][rid#63893050/initial] (3) [perdir d:\westlund\] applying pattern ^(.*)/$ to uri FRENCH/default.aspx
To me it looks like I am not getting picking up the URL Parameters in my rule, but I can't seem to figure out why.
My rule file is show below.
RewriteEngine On
#This is the rule I am working with RewriteCond %{REQUEST_URI} ^/FRENCH/default.aspx.*$ [NC] RewriteRule ^/FRENCH/default.aspx$id=(\d)$ /FRENCH/SubDir/default.aspx?id=$1 [NC,L]
#The remaining rules work just fine and are required. RewriteMap map txt:mapfile.txt [NC] RewriteMap lower int:tolower RewriteCond %{REQUEST_URI} ^(.+).*$ [NC] RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND RewriteRule .? ${map:${lower:%1}} [NC,R=301,L] # Rewrite old category urls
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ index.php/$1 [NC,L]
|
| Back to Top |
|
| |
Guests Guest

Joined: 01 October 2003
Online Status: Online Posts: -149
|
| Posted: 14 November 2011 at 7:24am | IP Logged
|
|
|
Hello,
Please, try to replace existing:
Code:
RewriteCond %{REQUEST_URI} ^/FRENCH/default.aspx.*$ [NC]
RewriteRule ^/FRENCH/default.aspx$id=(\d)$ /FRENCH/SubDir/default.aspx?id=$1 [NC,L] |
|
|
with
Code:
RewriteCond %{REQUEST_URI} ^/FRENCH/default.aspx.*$ [NC]
RewriteRule ^/FRENCH/default\.aspx$ /FRENCH/SubDir/default.aspx [QSA,NC,L] |
|
|
Regards
Andrew
Edited by AndrushkaUS - 14 November 2011 at 7:32am
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You can vote in polls in this forum
|