Hyphen, underscore, or camelCase as word delimiter in URIs?

后端 未结 6 1431
别跟我提以往
别跟我提以往 2020-12-04 04:07

I\'m designing an HTTP-based API for an intranet app. I realize it\'s a pretty small concern in the grand scheme of things, but: should I use hyphens, underscores, o

6条回答
  •  青春惊慌失措
    2020-12-04 04:55

    here's the best of both worlds.

    I also "like" underscores, besides all your positive points about them, there is also a certain old-school style to them.

    So what I do is use underscores and simply add a small rewrite rule to your Apache's .htaccess file to re-write all underscores to hyphens.

    https://yoast.com/apache-rewrite-dash-underscore/

提交回复
热议问题