views:

98

answers:

3

Hi

I am using below rule to read the URL like

URL: http://www.example.com/blog/sampe-post-title/10004/

RULE:

RewriteRule (.*)/(.*)/([0-9]+)/$ $1/details.asp?mod_id=$3 [NS,I]

Everything was fine untill I discovered that links coming via feedburner are not working anymore. Because feedburner adds some extra parameter to URL for stats/tracking etc.

For example www.example.com/blog/sampe-post-title/10004/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed:+somesite+(my+feed)

My rewrite URL doesn't recognizes the above URL anymore. Any idea how to deal with it?

A: 

Try the QSA flag to get the original requested URL query automatically appended to the new one.

Gumbo
+2  A: 

Try adding a rule for the feedburner URLs:

RewriteRule (.*)/(.*)/([0-9]+)/\?(.*)$ $1/details.asp?mod_id=$3&$4 [NS,I]

I added an extra RegEx group at the end to capture everything after the question mark and place it after mod_id. You could probably combine this with your other URL if you only wanted to have one rule for some reason, but you might as well just have two.

SoapBox
thats right, use it
pinusnegra
Thanks ... its working fine now
suraj jain
The URL query is not part of the URL path. So you can’t test it with the `RewriteRule` as it only operates on the URL path. You need the `RewriteCond` directive to do so.
Gumbo
A: 

wow.. once again i figured out the answer of my own .. just replaced the ending $ with .* ..thats it

here is the modified rule ..it works like charm now

RewriteRule (.*)/(.*)/([0-9]+)/.* $1/details.asp?mod_id=$3 [NS,I]
suraj jain