-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: API requests with a trailing forward slash #3330
Comments
|
Not really a bug. Trailing slashes are redirected by default. But now I started to wonder if these rules should be enabled by default. If you want to change this behavior, edit your |
I see, not sure what the purpose is of redirecting on trailing slashes but when calling these routes as a resource the results are not correct and can cause some frustration trying to figure out what's wrong. Took me a few hours to figure this one out. Removing the lines in the .htaccess fixes the issue. Thanks! |
In this article, Google's John Mueller clarified what counts as duplicate content in this tweet.
|
On all my internal APIs that shouldn't be a problem to cover. My only concern is when I have APIs available to the public. Lets say someone uses one of my API end points on Zapier or whatever. They inadvertently add the trailing slash. The user might get frustrated and think my APIs do not work. Just my two cents. Now that I understand the reasoning behind it, I have no problem excluding trailing slashes. |
Okay, I guess we're leaving this as it is. |
I spent a lot of time trying to figure out why my routes were not working and found that I needed to exclude the trailing forward slash.
Example:
POST http://localhost/API/news/ will send you to the GET (http://localhost/API/news/view) route
POST http://localhost/API/news will work correctly
Even if I set my route with the trailing forward slash I still get routed to API\news::view.
CI Version 4.0.4
The text was updated successfully, but these errors were encountered: