Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use an at (@) sign in the path part of an url

Tags:

url

I know it can't be part of the authority section as usernames with an @ are used there, but can I use it in the path section.

The reason I want to use it is as part of an url for a users resources. eg

www.example.com/[email protected]/someresource

like image 434
SystemicPlural Avatar asked Jan 13 '23 03:01

SystemicPlural


2 Answers

The @ symbol is a reserved character in RFC 3986 so it is not allowed in your URL. It would be converted to %40 when URL encoding is used.

like image 133
Brett Avatar answered Mar 16 '23 07:03

Brett


In your case, best practice for RESTful and nice URLS, it should be www.example.com/domain.com/user/someresource

like image 23
igo Avatar answered Mar 16 '23 06:03

igo