开发者

simple url rewriting problem

开发者 https://www.devze.com 2023-02-26 03:49 出处:网络
I have an existing website where i have urls like: /application/index/fuseaction/home.uebersicht/a/44/b/45/web/xyz.htm

I have an existing website where i have urls like:

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

I now want to redirect to:

/xyz.html

what it tried is

开发者_运维问答
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]


If this is an inbound rule then this should work for you:

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

I'm assuming that the missing l from the long url in your example was intentional.

0

精彩评论

暂无评论...
验证码 换一张
取 消