Solved

modify .htaccess in order to redirect from http:///www.mydomain.com to https://171.25.36.24/claire

Posted on 2013-06-12
7
210 Views
Last Modified: 2013-06-12
Hi there,
I would like to modify my htaccess as you guest go to http://www.monexemple.com: he will be torwars to https://171.25.36.24/claire
Please help me,
Thank,
Regards,
Simlip
0
Comment
Question by:simlip
  • 4
  • 2
7 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39241022
You can do this in PHP.  This is untested, but probably correct in principle.  You might want to add the header(301).

<?php header("Location: https://171.25.36.24/claire");

Open in new window

0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39241041
RewriteEngine on
RewriteCond %{HTTP_HOST} ^monexemple\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.monexemple\.com$
RewriteRule ^/?$ "https\:\/\/171\.25\.36\.24\/claire" [R=301,L]

Open in new window

0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39241047
Note: The user will get a SSL warning on an IP address when they are redirected. You should change that to a domain with SSL or remove the "s" in https if SSL is not required.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:simlip
ID: 39241105
Hi there,
Thank for you help
RewriteRule ^/?$ "https\:\/\/171\.25\.36\.24\/claire" [R=301,L] , multiple \ is it a bug ?
For the moment, we use ssl autosigned and we have a warning.
Regards
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39241130
no, these are escape strings not bugs. Have you tried it?
0
 
LVL 7

Accepted Solution

by:
Robert Saylor earned 500 total points
ID: 39241152
Here is another example:

My domain http://demo.customphpdesign.com will now redirect to the company's domain that I work for:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^demo\.customphpdesign\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.demo\.customphpdesign\.com$
RewriteRule ^/?$ "http\:\/\/www\.aggressor\.com\/" [R=301,L]

Open in new window

0
 

Author Comment

by:simlip
ID: 39241550
Thank,
It is working fine :)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question