简体   繁体   English

返回所有以.php结尾的页面的HTTP状态代码301

[英]Return HTTP Status Code 301 for all pages ending on .php

How would I redirect all pages on my website that have /de/ .php or /en/ .php in the URL? 如何重定向网站上URL中包含/ de / .php或/ en / .php的所有页面? I dont want to redirect domain.com/index.php though, only domain.com/de/.php or /en/*.php. 我不想重定向domain.com/index.php,仅重定向domain.com/de/.php或/en/*.php。

您可以使用此规则

RewriteRule ^(en|de)/(.*?)\.php$ / [R=301,L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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