Forum Moderators: phranque

Message Too Old, No Replies

RedirectMatch expression

trailing / is ignored

         

mikaellowgren

10:10 am on Sep 29, 2004 (gmt 0)



I need to redirect from http:/#*$!x/norrtaljehc to a longer url. I wrote this and it workes for .../norrtaljehc/ but not for xxx/norrtaljehc

RedirectMatch ^/norrtaljehc[^calendar_folder,^icons](.*)$ /gn/opencms/web/HAB/_Subwebbar/hc_norrtalje/
RedirectMatch ^/[^calendar_folder,^icons,^norrtaljehc](.*)$¦^/$ /gn/opencms/web/HAB/

I allso have an alias on xxx/calendar_folder, therefor I mask it out aswell.
I can't figure out a sullution to this problem. Any ideas?

Thanks.

jdMorgan

2:30 pm on Sep 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This code fragment looks like a problem:

[^calendar_folder,^icons,^norrtaljehc]

This code says:
If the single character in this position is not c or a or l or e or n or d or a (again) or r or comma, or ^ or i or c, etc., then match.

If you wish to exclude the words calendar or icon, etc, then this won't work.

Can you use mod_rewrite on your server? Doing so would make this job a lot easier.

Jim