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
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 110

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

751 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