且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

只重写URL的中间部分-mod .htaccess

更新时间:2023-02-24 10:19:22

您需要在规则中使用 R 标志,并避免使用 http:// https://在目标URL中.

You need to use R flag in your rule and avoid using http:// or https:// in target URL.

RewriteEngine On

RewriteRule ^cadeaushop/(.*)$ /hobby-cadeau-shop/$1 [R=302,NE,L]

同样重要的是使此规则保持在 RewriteEngine On RewriteBase 行下面.

Also important is to keep this rule just below RewriteEngine On OR RewriteBase line.