Skip to content
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

303 response code on wrong URLs instead of 404 response code #8573

Closed
Sulpher opened this issue Nov 30, 2015 · 9 comments
Closed

303 response code on wrong URLs instead of 404 response code #8573

Sulpher opened this issue Nov 30, 2015 · 9 comments

Comments

@Sulpher
Copy link

Sulpher commented Nov 30, 2015

Steps to reproduce the issue

I've tested new version of website had to make website offline and work on its SEO and to validate URLs in content. I turned website offline in global configuration, then log in a front-end under super administrator's credentials and tried to enter any wrong URL.
Correct url: /about-us.html
Incorrect url that I'm trying to enter: /about-us222abcd.html

Expected result

I must get 404 response code when input wrong URL.

Actual result

Redirect at index.php with 303 response code.

System information (as much as possible)

I tested it with Joomla 3.4.5

Additional comments

It's happen when website is offline and because of these .htaccess rules:

Begin - Joomla! core SEF Section.

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

If the requested path and file is not /index.php and the request

has not already been internally rewritten to the index.php script

RewriteCond %{REQUEST_URI} !^/index.php

and the requested path and file doesn't directly match a physical file

RewriteCond %{REQUEST_FILENAME} !-f

and the requested path and file doesn't directly match a physical folder

RewriteCond %{REQUEST_FILENAME} !-d

internally rewrite the request to the index.php script

RewriteRule .* index.php [L]

End - Joomla! core SEF Section.

Please take a look this issue happens when website is offline and you're logged in as user with enough permissions (administrator and above) at front-end side. URLs should work correct in offline too.

@Sulpher
Copy link
Author

Sulpher commented Nov 30, 2015

Oh, the .htaccess code was stripped in the message above.

Here is it:

Begin - Joomla! core SEF Section.

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

If the requested path and file is not /index.php and the request

has not already been internally rewritten to the index.php script

RewriteCond %{REQUEST_URI} !^/index.php

and the requested path and file doesn't directly match a physical file

RewriteCond %{REQUEST_FILENAME} !-f

and the requested path and file doesn't directly match a physical folder

RewriteCond %{REQUEST_FILENAME} !-d

internally rewrite the request to the index.php script

RewriteRule .* index.php [L]

End - Joomla! core SEF Section.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8573.

@Sulpher
Copy link
Author

Sulpher commented Nov 30, 2015

Damn.

I'm attaching the file.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8573.

@Sulpher
Copy link
Author

Sulpher commented Nov 30, 2015

screen shot 2015-11-30 at 03 34 09


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8573.

@brianteeman
Copy link
Contributor

I can confirm this on current staging


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8573.

@mbabker
Copy link
Contributor

mbabker commented May 8, 2016

The code in the error handler does a redirect on a 404 condition and the site is in offline mode. It doesn't account for additional things like whether the user is authenticated. So if someone wants to fix this, that's the type of check that's needed, otherwise it's expected behavior.

@ghost
Copy link

ghost commented Jan 28, 2017

See no Difference between "Site offline" or "Site online": index.php/menuname/artikelname-not-existing redirect on index.php/menuname.

Tested on:
Joomla! 3.7.0-beta1
macOS Sierra, 10.12.3
Firefox 50.1.0
PHP 7.0.4
MySQLi 5.5.53-0

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/8573

@ghost
Copy link

ghost commented Nov 8, 2017

closed due the lack of Response. It can always reopened if needed.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8573.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/8573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants