Solved

htaccess redirect subdomain to root directory

Posted on 2014-09-02
4
370 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Multiple SSL sites on one IP? 3 42
NGINX/Apache redirect on 403 and 404 5 159
Domino Website - Redirection 12 99
Tomcat on Windows.  URL with {curly braces} fails. 1 194
In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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