简体   繁体   中英

How to remove a directory from URL with .htaccess..?

Ok, I've read so many examples on so many sites, it gets really hard to understand what's going on when it seems there are dozens of way to do anything with .htaccess.

Anyway, here's my setup: I have 2 domain names example1.com and example2.com

example1.com is an add-on domain, so its root is in the subfolder /example1.com/ on my server. When I type www.example1.com, that's what I see: http://www.example1.com/ That's perfectly fine.

example2.com is a parked domain, it points to the same folder /example1.com/ . When I type www.example2.com, that's what I see: http://www.example2.com/example1.com/ I would like NOT to see the subfolder, I would like to see http://www.example2.com/ but have the same content served.

There must be a way to do this with htaccess. I Hope someone can help.

Thanks.

You could use an iframe (ie: A box that syndicates another web-page) and skip any hassle with htaccess. The results are indistinguishable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM