Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache Rewrite Module

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have had some trouble with my ISP blocking port 80 requests (incoming trafic). In fact they are blocking all incoming traffic on port 80 to all their customers, which means i cant continue to host websites on the default port, and host them by just their domain (ie: itsnotbutter.org...now i have to do itsnotbutter.org:8080)
So i searched around and found out about this method with the rewrite module in apache, and how u can use an external HTTP redirect for my domain/s..(my goal is to have people request itsnotbutter.org but actually be requesting itsnotbutter.org:8080)

i took apaches configuration straight from the rewrite module section of their website, and edited it a little to make it work with my domain, however i cannot seem to do so...Maybe one of you can help me out with this, here is the default module "script" from the apache site..(

RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name[NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) [L,R]
RewriteCond %{HTTP_HOST} !^fully\.qualified\.domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) [L,R]

(all lines should start with Rewrite..if they dont that means it didnt fit on the line in this forums cgi box input thing)
 
The rewrite directive affects what documents are served after a request is made. i.e.: change all .html request to actually serve up .php documents ... or if you moved a section of your pages to a different server/sub domain.

Since the original request for your web pages will still be comming in on the default port (80) and your ISP has blocked all incoming traffic to port 80 ... then Apache will never get the chance to use its rewrite.

Did your ISP block port 80 in an attempt to combat CodeRed or did they do it to stop it users from hosting web pages? If they did it to combat CodeRed ... then that is a pretty drastic move on their part. Talk to them to see if they can reopen port 80 for your server (Apache cannot be infected by code red). If they did it to stop you from hosting web pages ... then you are going to have to find an outside system to redirect your customers to the new port.

example:
Rename your server that is inside your ISP to something other than web, etc), and point the DNS entry of that new name to your server inside your ISP. Change Apache to listen to port 8080 instead of 80

Find a free/cheap web host that can support virtual domains.
Point the DNS entry of to the free/cheap web server outside your ISP. Create the default page on this web server with a meta refresh :
<meta http-equiv=&quot;Refresh&quot; content=&quot;0;URL=http://www2.itsnotbutter.org:8080&quot;>

This page will automatically send your visitors to the &quot;new&quot; web server ( on the correct port. Making it nearly transparent for the average user.


This is at least how I would do it ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top