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
211 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

830 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