urgent help with a rule
9 posts
• Page 1 of 1
- deepakrajr
- Posts: 5
- Joined: 16 Aug 2012, 05:10
urgent help with a rule
HI
I have this current rule which returns a 404page if there is is anything passed after the .htm.
thw below rule works perfect.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm[^a-zA-Z].+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
Now i need a exception put into this rule if in .htm pages has a ?gclid= allow rest of the string should return a 404 page as it is doing now.
can you please help me with this rule.
regards
deepak
I have this current rule which returns a 404page if there is is anything passed after the .htm.
thw below rule works perfect.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm[^a-zA-Z].+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
Now i need a exception put into this rule if in .htm pages has a ?gclid= allow rest of the string should return a 404 page as it is doing now.
can you please help me with this rule.
regards
deepak
Re: urgent help with a rule
Hello, Deepak
Please try it like this:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
Please try it like this:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
- deepakrajr
- Posts: 5
- Joined: 16 Aug 2012, 05:10
Re: urgent help with a rule
HI Anton,
thanks for your reply.The below rule works for what i want but there is a problem.i have .htm and .html pages.once i implemente the below mentioned rule my .html pages stop working.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
can you please help me
thanks
deepak
thanks for your reply.The below rule works for what i want but there is a problem.i have .htm and .html pages.once i implemente the below mentioned rule my .html pages stop working.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
can you please help me
thanks
deepak
- deepakrajr
- Posts: 5
- Joined: 16 Aug 2012, 05:10
Re: urgent help with a rule
HI Anton,
thanks for your reply.The below rule works for what i want but there is a problem.i have .htm and .html pages.once i implemente the below mentioned rule my .html pages stop working.
I want the rule to fire only for .htm pages not for the .html pages.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
can you please help me
thanks
deepak
thanks for your reply.The below rule works for what i want but there is a problem.i have .htm and .html pages.once i implemente the below mentioned rule my .html pages stop working.
I want the rule to fire only for .htm pages not for the .html pages.
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
can you please help me
thanks
deepak
Re: urgent help with a rule
Hello,
please have this small fix:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.html?(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
please have this small fix:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.html?(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
- deepakrajr
- Posts: 5
- Joined: 16 Aug 2012, 05:10
Re: urgent help with a rule
HI Anton,
i think there is a misundestanding.Below mentioned rule works as per i want.But i have filetype in our website which is .html and .htm
i want this rule to fire only for .htm file types.For .html and other file types as asp or aspx i dont want this rule to fire.
IF the below rule it works fine but if i visit a .html file type page then it redirects to a 404 page which i dont want.
As mentioned above i need this rule only to fire for .htm pages.can you please help me
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
thanks
deepak
i think there is a misundestanding.Below mentioned rule works as per i want.But i have filetype in our website which is .html and .htm
i want this rule to fire only for .htm file types.For .html and other file types as asp or aspx i dont want this rule to fire.
IF the below rule it works fine but if i visit a .html file type page then it redirects to a 404 page which i dont want.
As mentioned above i need this rule only to fire for .htm pages.can you please help me
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*).+ http\://xxx.x.com/error/404_test.asp [U,CL,L]
thanks
deepak
Re: urgent help with a rule
Sorry, I got it wrong.
Here's the rule which should work for you:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*)(\?.+) http\://xxx.x.com/error/404_test.asp [U,CL,L]
Here's the rule which should work for you:
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*)(\?.+) http\://xxx.x.com/error/404_test.asp [U,CL,L]
- deepakrajr
- Posts: 5
- Joined: 16 Aug 2012, 05:10
Re: urgent help with a rule
HI Anton,
this rule works fine.But i have another rule which rule runs below the above rule.
For now the below mentioned rule has be commented.
The below rule gives a 404 header for the url ending with / .ie. x.x.com/folder/subfolder/filename.htm/ should return a 404 page.
how can i tweak this rule so it works perfectly with the gclid rule.
RewriteCond Host: (?:x\.x\.com.*)
RewriteRule [^?]+?\.htm[/?].* http\://x.x.com/error/404_test.asp [U,CL,L]
regards
deepak
this rule works fine.But i have another rule which rule runs below the above rule.
For now the below mentioned rule has be commented.
The below rule gives a 404 header for the url ending with / .ie. x.x.com/folder/subfolder/filename.htm/ should return a 404 page.
how can i tweak this rule so it works perfectly with the gclid rule.
RewriteCond Host: (?:x\.x\.com.*)
RewriteRule [^?]+?\.htm[/?].* http\://x.x.com/error/404_test.asp [U,CL,L]
regards
deepak
Re: urgent help with a rule
Hello, Deepak
Please try to have the rules like this:
RewriteCond Host: x\.x\.com.*
RewriteRule .+\.htm/ http\://x.x.com/error/404_test.asp [U,CL,L]
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*)(\?.+) http\://xxx.x.com/error/404_test.asp [U,CL,L]
Please try to have the rules like this:
RewriteCond Host: x\.x\.com.*
RewriteRule .+\.htm/ http\://x.x.com/error/404_test.asp [U,CL,L]
#end of \ slash in the url only for htm pages
RewriteCond Host: (?:xxx\.xxxl\.com.*)
RewriteRule .+\.htm(?!.*gclid=allow.*)(\?.+) http\://xxx.x.com/error/404_test.asp [U,CL,L]
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests