top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Query regarding mod_rewrite module when handling URLs

+1 vote
31 views

In our setup, we need to do conditional-redirects. Till now, we were able to accomplish them, by using a smart combination of "RewriteCond", "RewriteRule" and "QSA".

However, we now face a situation, wherein we need to do re-directs, only if the original-URL does not contain POST-variables/parameters (although they may contain any number of GET-variables). Going through the "mod_rewrite" documentation, I could not find any way to do conditional-redirect, for URLs containing POST-variables/parameters.

Is it even possible to accomplish via HTTPD?

posted Sep 3, 2013 by Abhay Kulkarni

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

Here's a hint:

RewriteCond %{REQUEST_METHOD} ^POST$
RewriteRule ......
answer Sep 3, 2013 by Majula Joshi
Similar Questions
0 votes

I am a bit confused about the mod_rewrite documentation. It shows this rule to block hotlinking:

RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

however, I'd think a better rule would be:

RewriteCond "%{HTTP_REFERER}" "^$" [OR]
RewriteCond "%{HTTP_REFERER}" "!(www.)?example.com/.*$" [OR,NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

if I want to block anyone manually typing in a link (no referer) + hotlinking (probably has a referer). Do i need the [OR] on the 1st
RewriteCond and not the 2nd one? It seems to work with OR on both conditions.

+1 vote

Just set up a FreeBSD jail to run httpd in it and all works good except these two, rewrite/proxy modules.

These are error logs excerpts:

MOD_REWRITE error: 
[rewrite:crit] [pid 43447] (13)Permission denied: AH00666: mod_rewrite: could not init rewrite_mapr_lock_acquire in child 
MOD_PROXYÂ error: 
[proxy:crit] [pid 43447] (13)Permission denied: AH02479: could not init proxy_mutex in child 

Not sure permissions of what are being denied as html in document root is being served just fine when these modules are disabled.

I tried googling but found nothing but rubbish. Please help?

0 votes

My System : CentOS Linux release 7.2.1511 (Core)
My Apache version : Apache/2.4.6 (CentOS)

I have configured two httpd instance.

I'm looking for a way to use "apachectl fullstatus" command for the second instance. Is this possible?

0 votes

I have two handlers to be accessed. My motive is to use the second handler if the first handler returns DECLINED.

I have tried various combinations of SetHandler, AddHandler and AddType but none has worked as overriding takes place in all of these combinations.

Is there any method in Apache to use more than one handler without overriding?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...