Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
220 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 111

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
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 …
Suggested Courses

772 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