user160820
user160820

Reputation: 15200

simple url rewriting problem

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]

Upvotes: 0

Views: 140

Answers (1)

Kev
Kev

Reputation: 119806

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.

Upvotes: 1

Related Questions