Home Apache rewrite configuration not working
Reply: 0

Apache rewrite configuration not working

user873 Published in August 15, 2018, 5:36 am

I have a use case where I only want to forward the request to localhost only if url of the below forms and ItemType equals x.


RewriteCond %{THE_REQUEST} !\s/d/
RewriteCond %{QUERY_STING} (?:^|&)ItemType=(x)(?:&|$) [NC]
RewriteRule ^/(.*)$  http://google.com/$1 [R=301,L,NC]

RewriteCond %{THE_REQUEST} \s/d/
RewriteCond %{QUERY_STRING} (?:^|&)ItemType=(x)(?:&|$) [NC]
RewriteRule ^/?d/(.*)$  http://localhost:15790/$1 [P,NE,L,NC]

The above configuration is not working for me. First rewriting works fine but second is also using the first rewriting. Can somebody explain me what I am doing wrong?

Note:I am new to this rewriting URLs. Also can somebody help me with where I can find the logs?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294201 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO