简体   繁体   中英

.htaccess redirect all other pages after manual 301's

so we have a whole load of 301 redirect's in out htaccess because we migrated to a new site and a lot of the content is in a different location now. I need to add something to catch the rest of the URL's that aren't manually specified and point them to our homepage.

You can use this redirect rule as very last rule (after all of your other rewrite rules) :

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . / [L,R=302]

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