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
Solved

htaccess redirect subdomain to root directory

Posted on 2014-09-02
4
365 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
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
Edwin Hoffer earned 500 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
 
LVL 5

Expert Comment

by:Omid Omarkhail
ID: 40300428
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 14

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

790 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