I am trying to redirect a subset of pages that have been removed from a website to a specific 404 page using htaccess.
I currently have this rule in my htaccess:
RewriteRule ^de/Engineering.*$ /error/ [R,L]
This works, but the url changes in the browser to error, which is bad for search engine bots, and the returned code is 302. I would like the url to remain the same (silent redirect) and the status code to change. The target page returns a correct 404 code so I need to pass that back through.
当/error/
文档已经返回404
状态代码时,您可以省略R
标志
RewriteRule ^de/Engineering.*$ /error/ [L]
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.