Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

htaccess redirect subdomain to root directory

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
ddantes
Asked:
ddantes
  • 2
1 Solution
 
Edwin HofferTechnical ExpertCommented:
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
 
ddantesAuthor Commented:
Thanks to both experts.  Edwin:  are you saying that the .htaccess belongs in the subdomain folder, not in the root folder?
0
 
Edwin HofferTechnical ExpertCommented:
Use it in the main root folder and change the folder path to your folder name.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now