soft linking for apache?
I'm not sure if my subject accurately describes what I'm trying to do.
I have an http server running on port 4444 and I would like to be able to access it via a subdirectory on port 80. Here's an example: htttp://myserver:80/gobble/index.html would take the visitor to: htttp://myserver:4444/index.html And another one: htttp://myserver:80/gobble/hibble/index.html would take the visitor to: htttp://myserver:4444/hibble/index.html . Currently the best thing I've come up with is creating a refresh meta tag for all files that I expect visitors will enter. I apologize if I put the post in the wrong forum, Thanks for the help! Serge |
Hi,
What you want to do is called port forwarding, and it's not specific to apache. In linux you can do it using iptables. You will find detailed instructions in the iptables documentation. Arvind |
Thanks Arvind, I took a look at port forwarding, but that forwards the whole port (80 to 4444 for instance). Do you know of a way offhand to forward just "domain:80/directory" to "domain:4444/"? Maybe I missed it in the iptables docs, I'll keep looking. Thanks again
Serge |
Hi,
Sorry I didn't understand your question correctly the first time. Of course what you have is an apache question :) Apache has a thing called mod_rewrite. I've never used it myself but I think it can do what you want, because it is supposed to be able to handle any kind of URL redirection imaginable. Google will give you a wealth of resources. Arvind |
There is a pretty good URL Rewriting Guide over on the Apache site that explains mod_rewrite pretty well.
|
Thank you very much stickman and arvind, I got it working :) The only problem was that I could not do a RewriteLock or RewriteLog because I kept getting "RewriteLog not allowed here" no matter where I tried to put it.
My current setup is: <Directory /var/www/html> RewriteEngine ON RewriteBase /directory RewriteRule ^directory(.+) http://server:4444$1 [R,L] </Directory> If anyone knows why I cannot get a RewriteLock or RewriteLog please let me know. Thanks!!! |
All times are GMT -5. The time now is 05:47 PM. |