: RewriteRule for URLs with spaces My site's pages are in multiple languages whereby each language version shares its media (images) with the other language versions. I place all versions and the
My site's pages are in multiple languages whereby each language version shares its media (images) with the other language versions. I place all versions and the media in a single directory with the same name. E.g. pages mypage-en.html, mypage-fr.html etc. will sit in directory mypage. The directory path suffices to reference a page:
h t t p : //....../mypage/
is good enough, there is no need for
h t t p : //....../mypage/mypage-en/html
A rewrite with
RewriteRule ^(.*)/([a-zA-Z0-9]+)/?$ ///-en.html
lets me use the shorter form. But what if the name mypage contains spaces (which some do) ?
I want
h t t p : //....../my page/
to lead to
h t t p : //....../my page/my page.html
Using
RewriteRule ^(.*)/([a-zA-Z0-9|s]+)/?$ ///-en.html
did not work.
Any hints welcome.
(please do not ask me why I want to do this, nor tell me I should not use spaces in file names)
More posts by @Murray155
1 Comments
Sorted by latest first Latest Oldest Best
You don't want the |s in your matching group. A plain space [a-zA-Z0-9 ] should be fine.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.