0

我有一个现有的网站,其中有如下网址:

/application/index/fuseaction/home.uebersicht/a/44/b/45/web/xyz.htm

我现在想重定向到:

/xyz.html

它尝试的是

RewriteCond %{HTTP:Host} ^(?:www\.)?mysite.coml$
RewriteCond %{REQUEST_URI} application/index\.cfm.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteMap docmap_301 txt: mapping301.txt
RewriteRule ^/application/index.\cfm/(.*)\.htm ${docmap_301:$1} [NC,L,NS]
4

1 回答 1

1

如果这是入站规则,那么这应该适合您:

Rewrite Engine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+)/((.+).htm) $2l [NC,R=302]

我假设l您示例中长网址的缺失是故意的。

于 2011-04-18T11:15:16.470 回答