0

i have this apache-php server runing with some php and mysql apps..
I also have this application that uses java and one module is running through RMI, and its automatically started by the init.d using a shell script...
then it's visible through a port (which is configured on the module java config file):

http://severipaddress:2000

I would like to know if there's a way to tell apache that i need this port to be secured through htaccess so a user / password can be asked before enter the application in:

http://severipaddress:2000

Is that possible?

Edited by menetas: n/a

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by network18
0

Okay I just thought you can't use apache rewrite module.

Maybe you need to use PHP to ask what the URL is and then use the PHP header to redirect it to the url with the port on the end.

Edited by Froger93: n/a

0

and how can i do that?
I also think i may be able to use .htaccess rewrite module, i just don't know how to make that happen..

when i access the http:// server:port, it loads the java app, before that, i need apache to ask for authentication.. then load the app.. is it possible to use rewrite module to do that?

i dunno if php can do it, since i have no way to redirect to the app other than the address http:// server:port and that's what im trying to secure...

Edited by menetas: n/a

0

if you want to allow access your website through secure http only, then putting this code in the htaccess will do that -

IndexIgnore *
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

it will rewrite all your url from http to https also.though i haven't tested it , I am sure it should work.

0

if you want to allow access your website through secure http only, then putting this code in the htaccess will do that -

IndexIgnore *
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

it will rewrite all your url from http to https also.though i haven't tested it , I am sure it should work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.