trouble with utf-8 chars & apache2 rewrite rules

前端 未结 6 1976
南方客
南方客 2021-02-19 23:46

I see the post validating utf-8 in htaccess rewrite rule and I think that is great, but a more fundamental problem I am having first:

I needed to expand to handle utf-

6条回答
  •  野的像风
    2021-02-20 00:40

    On...

    RewriteRule ^/puzzle/(\w+)$ /puzzle.php?g=$1 [NC]
    

    Someone correct me if I'm wrong, but wouldn't this mean get requests asking for subdirectories simply bypass this rule?

    Also, a lazy way to solve this is to also group in the '%' character. As far as I know, all you're allowed to work with is on any url path is url encoding. Actually, see: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

    I'm sure there are more advanced and better ways to do this, but that should solve your immediate problem.

提交回复
热议问题