LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2007, 06:26 AM   #1
FMH
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Rep: Reputation: 0
redirect some http requests to port 443.


Hi all
I want to redirect some http requests -that send to port 80- to port 443 in apache without changing their URLs.
for example redirect http://192.168.2.100/cardService to port 443 instead of port 80.
Can I do this ? if yes how can I do this?
thanks
 
Old 09-10-2007, 07:35 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If I understand you well, you want to redirect http://192.168.2.100/cardService to https://192.168.2.100/cardService. If that's want you want, then you can use the following rewrite rule:
Code:
RewriteEngine on
RewriteRule ^cardService$         https://192.168.2.100/cardService [L]
For more details you can read the apache documentation

Regards

Last edited by bathory; 09-10-2007 at 07:39 AM.
 
Old 09-12-2007, 06:32 AM   #3
FMH
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Dear bathory
I added the lines that you introduced, but when I check access_log , http request does'nt redirect to https request yet. although I added the following lines to httpd.conf.
<IfModule mod_rewrite.c>
<IfModule mod_rewrite.c>
RewriteLog /var/log/httpd/rewrite_log
RewriteLogLevel info
<Directory "/svr/www/htdocs/CardServices/controller" >
RewriteEngine on
Options +FollowSymLinks
Order allow,deny
Allow from all
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</Directory>

but it doesn't work yet. just Rewritelog was made but it is empty. how can we sure that RewriteEngine is realy ON or Re-write module works correctly?

Regards
 
Old 09-12-2007, 07:58 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
The <IfModule..> part must be changed to:
Code:
<IfModule mod_rewrite.c>
RewriteLogLevel 9
RewriteLog /var/log/httpd/rewrite_log
</IfModule>
After these changes I guess that rewrite should work.
 
Old 09-17-2007, 06:28 AM   #5
FMH
LQ Newbie
 
Registered: Sep 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Dear bathory
thanks for spending time to answer my question. I have another problem. In our web application we don't use get method, infact we closed get request but when I redirect our http request to https, get method is used instead of post. before redirection to https, these request works correctly (post method is used) but after redirection these request don't work correctly (get mothod is used).
Can we set some parameters until post method is used while redirection to https instead of get method.
Best Regards
 
Old 09-17-2007, 08:19 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I'm afraid I cannot help you further. You can take a look at this page to see if you find an example that fits your needs.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache redirect from 80 to 443 gabsik Linux - Networking 31 06-18-2006 06:37 AM
How to redirect http port 80 from slackware gateway to redhat proxy cmarasescu Linux - Networking 1 06-16-2006 09:26 PM
How can I redirect all requests for 1 ip to a different IP? with iptables abefroman Linux - Networking 1 08-31-2005 01:09 PM
turn off http port 80, keep https port 443 lothario Linux - Networking 6 02-11-2005 04:06 AM
Problem recving HTTP requests when Apache listens on port 80 hecter Linux - Networking 1 10-17-2004 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration