Forum Moderators: phranque
I'm a super newb when it comes to apache and I have come here for guidance. I have set up my apache server into a proxy and it is working fine. But, I need to modify the proxy so that anyone who connects to my proxy gets sent to a .html file on my computer. The reason for this is that I have 2 proxies and I want to take this one proxy down by putting up a page that tells the users to change their connection settings on their computer.
So, when people connect to my proxy; no matter what the user puts for a website it always goes to my specified file. i.e. user tries to go to www.google.com but gets sent to /user/stuff/MyPage.html
Would I have to use mod_rewrite for this or is there and easier way to do this? I don't even know where to start with this thing. Any suggestions are welcomed. Thanks in advance.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^$
RewriteRule (.*) file:/var/apache/htdos/index.html/$1 [R=301,L]
</IfModule>
I honestly don't know what I'm doing. i thought i knew what i was doing but i obviously don't. all i want is my proxy to automatically send the user to my file on the first connection. after that I think i can just trap them in an infinite loop.
please help. anyone please. S.O.S. MAYDAY MAYDAY!
Welcome to WebmasterWorld [webmasterworld.com]!
I suspect that many here could not figure out what you needed...
You are attempting to specify an external redirect by using [R=301]. I'd suggest just using [L]. Also, specify only a local path as the substitution, i.e., leave off the "file:" part.
Jim
So I'd suggest:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?yourcompany\.com [NC]
RewriteRule !\.(gif¦jpe?g¦png¦mp3¦wav¦au¦mpe?g¦wmv¦mov¦rmi¦avi¦asf¦swf)$ /htdocs/index.html [L]
Change all broken pipe "¦" characters to solid pipe characters before use -- posting on the board here modifies them.
Jim
the proxy server is my proxy server that I maintain. People connect to my proxy to surf the web. What I want to do is redirect all traffic going through my proxy to my index.html which is located on the proxy server itself.
For example:
USER1 -> connects to my proxy 12.34.56.78 -> they type in www.google.com (to go to google.com) -> but instead gets redirected to my index.html
USER1 -> connects to my proxy 12.34.56.78 -> they type in www.cnn.com (to go to cnn.com) -> they get redirected to my index.html
So what I'm trying to do is, when users connect through my proxy server (to surf the web) the server would ignore their requests and automatically send them to the index.html (located on the proxy itself) no matter what they type in. In essence it's a trap. The users would not be able to use my proxy server to surf and would be forced to view my notice page until they changed their internet connection settings.
The actual mod_rewrite stuff I am trying to do is on the proxy server itself.
i included the line: ProxyBlock *
in my mod_proxy.c directive to block all proxy requests and make it a HTTP error 403
then i added the line: ErrorDocument 403 /index.html
to have all server requests go to that document.
well it's giving me a HTTP 403 error but it's not going to the customized error page that I specified. any have any ideas why this isn't working?