Skip to ContentSkip to Footer
Start of content
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Apache URL Redirect
General
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-14-2010 12:22 AM
11-14-2010 12:22 AM
Hi,
I want to re direct the requestes which are coming to my server url to https://server/test.
It is working fine if i am giving http://server (http://server redirecting to https://server/test).This is achived by adding the following lines in httpd.conf.
RewriteEngine on
RewriteRule ^/$ https://server/test [R]
But if am giving https://server it is not rdirecting to https://server/test. How i can achive this?
Manoj K
I want to re direct the requestes which are coming to my server url to https://server/test.
It is working fine if i am giving http://server (http://server redirecting to https://server/test).This is achived by adding the following lines in httpd.conf.
RewriteEngine on
RewriteRule ^/$ https://server/test [R]
But if am giving https://server it is not rdirecting to https://server/test. How i can achive this?
Manoj K
Thanks and Regards,
Manoj K
Manoj K
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-14-2010 01:58 AM
11-14-2010 01:58 AM
Solution
There are many possible ways to structure your Apache configuration file.
If the same Apache instance offers both http and https services, one possible way to configure it is to have a separate VirtualHost block for one service (either http or https), and let the main server configuration cover the other service.
Another way is to have two VirtualHost blocks, one explicitly for http and the other for https.
So you may have to add your redirect definition to another spot in your configuration to make it take effect for the HTTPS service too. But without knowing how your Apache configuration is structured, I cannot tell you exactly where to put it.
By the way, using the RewriteEngine for such a simple redirect is probably overkill. A simpler way to redirect all requests for the server's front page to https://server/test would be:
RedirectMatch ^/$ https://server/test
If someone requests e.g. http://server/foo and you'll want it automatically redirected to https://server/test/foo instead, then:
RedirectMatch ^/(.*)$ https://server/test/$1
MK
If the same Apache instance offers both http and https services, one possible way to configure it is to have a separate VirtualHost block for one service (either http or https), and let the main server configuration cover the other service.
Another way is to have two VirtualHost blocks, one explicitly for http and the other for https.
So you may have to add your redirect definition to another spot in your configuration to make it take effect for the HTTPS service too. But without knowing how your Apache configuration is structured, I cannot tell you exactly where to put it.
By the way, using the RewriteEngine for such a simple redirect is probably overkill. A simpler way to redirect all requests for the server's front page to https://server/test would be:
RedirectMatch ^/$ https://server/test
If someone requests e.g. http://server/foo and you'll want it automatically redirected to https://server/test/foo instead, then:
RedirectMatch ^/(.*)$ https://server/test/$1
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-14-2010 04:38 AM
11-14-2010 04:38 AM
Re: Apache URL Redirect
Hi Matti,
Thanks for your support.
I have append the following line in httpd.conf
RedirectMatch ^/$ https://server/test
and it is solved the issue.
Manoj K
Thanks for your support.
I have append the following line in httpd.conf
RedirectMatch ^/$ https://server/test
and it is solved the issue.
Manoj K
Thanks and Regards,
Manoj K
Manoj K
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
End of content
United States
Hewlett Packard Enterprise International
Communities
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP