简体   繁体   中英

htaccess redirect only main directory

I have a list of around 800 single redirects, the .htaccess file is in my subdomain directory.

I'm using the syntax: Redirect 301 oldURL newURL

I need to do this redirect:

http://testsub.example.com/en >>> http://www.example.com/page/

Using this string

Redirect 301 /en http://www.example.com/page/

All the other url using the same structure are affected, causing errors.

Thanks

I've solved using

RewriteRule ^$ https://www.example.com/page/ [R=301,L]

Thanks

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