mod_rewrite with spaces in the urls

后端 未结 5 1984
野性不改
野性不改 2020-12-09 08:03

I need to set up some RewriteRules to redirect a URL which has a space in it. I\'ve tried this:

RewriteRule ^article/with%20spaces.html$ /article/without_spa         


        
5条回答
  •  情书的邮戳
    2020-12-09 08:19

    Ah, I've found a solution: use the regex style to show a space:

    RewriteRule ^article/with\sspaces.html$ ...
    

    Though, I suspect that this would match all the other whitespace characters too (tabs, etc), but I don't think it's going to be much of a problem.

提交回复
热议问题