.htaccess 通配符文件夹将 301 重定向到 Perl 脚本



>我目前有一个网站,我想用"booth"一词重定向"ANY/ALL"请求(不区分大小写),我的链接结构如下所示:

  • www.url.com/booth102
  • www.url.com/booth103
  • www.url.com/booth104

我似乎无法弄清楚,但这是我到目前为止所拥有的:

  //Rewrite to www
  Options +FollowSymLinks
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^.url.com[nc]
  RewriteRule ^(.*)$ http://www.url.com/$1 [r=301,nc]
  //301 Redirect Old File
  RedirectMatch 301 /booth(*) http://www.url.com/cgi-bin/test.pl

我想通了:

# Enable Rrewrite Engine
Options +FollowSymLinks
RewriteEngine on
# Rewrite SEO Friendly URL
RewriteRule ^booth.* /cgi-bin/PerlScript.pl?Target=$0 [L,NC]

最新更新