My urls are in this form
/sites/site-name/Subpath-2/page-name.page
/sites/site-name/Subpath-3/Subpath-4/index.page
And this should be rewritten as /sitename/subpath/pagename
(the extention .page
is removed)
also the subpath can have multiple folders ie (/sites/site-name/Subpath-2/..../page-name.page)
If we have a url ending with index.page then we must remove the index.page eg:
/sites/site-name/...subpath.../index.page
should be /sites/site-name/...subpath.../
I have tried using back references in this way
ProxyHTMLURLMap "\/sites\/([A-Za-z-0-9]+|-)\/([A-Za-z-0-9]+|-)\/([A-Za-z-0-9]+|-)\.page$" "/$1/$2/$3" R
And for urls ending with index
ProxyHTMLURLMap "\/sites\/([A-Za-z-0-9]+|-)\/([A-Za-z-0-9]+|-)\/(index)\.page$" "/$1/$2/" R
But I need to rewrite the URLs in such away that the subpaths can be many ie it should work for any urls which can have more that three subpaths
it needs to work for /sites/site-name/Subpath-3/Subpath-4/index.page
/sites/site-name/Subpath-1/Subpath-2/Subpath-3/home.page