Solved

.htaccess redirection issues

Posted on 2014-12-06
3
113 Views
Last Modified: 2015-02-07
.htaccess goals:
1) When someone goes to mysite.com/abc it should reroute to http://info.mysite.com/abc
2) Otherwise go to mysite.com/test
And in all cases keep all name value pairs for GETs

What I have isn't working - when I put in mysite.com/abc it redirects to http://www.mysite.com/info.mysite.com/abc instead of http://info.mysite.com/abc. Can you tell me how to fix what I have:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com\/abc$
RewriteRule ^/?$ "http\:\/\/info\.mysite\.com\/abc" [R=301,L]

RewriteCond %{HTTP_HOST} ^mysite\.com$
RewriteCond %{HTTP_HOST} !^info\.mysite\.com$
RewriteRule ^/?$ "http\:\/\/mysite\.com\/test" [R=301,L]

# Use PHP5.4 Single php.ini as default
AddHandler application/x-httpd-php54s .php
0
Comment
Question by:LauraLaura1
3 Comments
 
LVL 13

Accepted Solution

by:
Edwin Hoffer earned 500 total points
ID: 40484643
Use the below code in your .htaccess file:

Redirect 301 /abc http://info.mysite.com/abc

Open in new window


Update /abc to your folder and update http://info.mysite.com/abc to the website where you want to redirect the abc folder.

Hope it will work for you

Thanks
Edwin
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 40595448
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 49
mapAB Challlenge 35 88
python question 5 58
installing beyond compare in portable puppy linux 1 47
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now