?
Solved

htaccess redirect subdomain to root directory

Posted on 2014-09-02
4
Medium Priority
?
388 Views
Last Modified: 2014-09-03
I need to 301 redirect www.mauivacationrental.com/MAU to www.mauivacationrental.com    I tried this code, but it isn't working.  Please advise.


#redirect /MAU to root directory
RedirectMatch 301 www.mauivacationrental.com/MAU(.*) www.mauivacationrental.com/$1
0
Comment
Question by:ddantes
[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
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Edwin Hoffer earned 2000 total points
ID: 40300322
Add below code in your .htaccess file which is in the folder:

redirect 301 /folder /index.php or index.html or domain name

Open in new window


Change your index file extension or use domain name.

Also if you have many files in the folder then you have to redirect all pages by using 3.1 code.

Thanks
Edwin
0
 

Author Comment

by:ddantes
ID: 40301595
Thanks to both experts.  Edwin:  are you saying that the .htaccess belongs in the subdomain folder, not in the root folder?
0
 
LVL 15

Expert Comment

by:Edwin Hoffer
ID: 40302691
Use it in the main root folder and change the folder path to your folder name.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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 …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

800 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