Apache rewrite rule
Hi,
I want to write apache rewrite rule which will allow only one IP address and not use SSL for that IP address. Currently i am using below rewrite code but this is not working. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L] This is not working in my case. |
Hi,
If I understand correctly what you're trying to do, then you can give a 403 error if the client is not 1.2.3.4 and use https if it is: Code:
RewriteEngine On |
My usecase is that we have two server and in one server we have configured ssl and in other server I.e apache jon ask server
Which is rubbing on port 80. I want that if a request is coming from 1.2.3.4 IP address that we will served from non ssl port. |
Quote:
Code:
RewriteEngine On |
Thanks for your help. Could you please confirm if in future if i want to write such rewrite code then is there any online site for writing these code.
|
Hi,
Quote:
Use your favorite search engine to find and test them Regards |
Hi,
I am trying to write one apache rewrite code but don't know the exact code. My requirement is if that if someone hit my particular link to access it without authorization it will redirect request to any other link. For example: http://abc.com/hub/pdffolder/.pdf to http://abc.com/bin/servive/sendcode?...pdffolder/.pdf link In this folder pdffolder it contain any write like .txt .pdf etc http://abc.com/hub/pdffolder/.pdf |
Quote:
What you can do, is to redirect the 401 response to the URL you want. E.g. add a .htaccess in /hub/pdffolder containing: Code:
ErrorDocument 401 /bin/servive/sendcode?=uri/hub/pdffolder/.pdf |
All times are GMT -5. The time now is 11:00 AM. |