Welcome Guest, Not a member yet? Register   Sign In
No 404 on existing folders
#11

(04-19-2015, 07:25 AM)BABYpanda Wrote: Thanks for your reply. The RewriteBase is set to "/" in the htaccess of the subdomain.

I really have no idea why it does these things, pretty much..



Code:
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

thats the .htaccess in the subdomain.

This url gives a correct 404 error:
http://test.example.com/index.php?/application

but this gives the weirds symbols..
http://test.example.com/application

Your RewriteCond is checking for index.php, so http://test.example.com/index.php?/application isn't rewritten, but http://test.example.com/application is being rewritten. In theory, if it is being rewritten to the same thing, it should work the same way.

Quote:
Code:
ERROR - 2015-04-19 16:32:32 --> 404 Page Not Found --> application


Does this show up for both URLs? In theory, it should, which would mean that both URLs are going through show_404(), I just don't understand why one would have a different result from the other.
Reply
#12

(04-20-2015, 08:11 AM)mwhitney Wrote: Does this show up for both URLs? In theory, it should, which would mean that both URLs are going through show_404(), I just don't understand why one would have a different result from the other.

Both give a 404 error according to the logs, but one 1 (the one with the index.php) does show a correct 404 error and the one without the index.php shows weird symbols.

That's the reason I asked here, I really dont get it anymore :/
Reply
#13

I take is as nobody knows the cause of this strange behavior ? Sad
Reply
#14

I'm really out of ideas. Generally, I would try to see if it makes a difference to remove the RewriteBase when it's in the subdomain, and maybe try to see if it works when you replace your current RewriteRule with a more common set of rules. I know that most of the rewrite configuration on my server started with the .htaccess code in Bonfire, but I've had to make modifications for almost every environment.
Reply
#15

It is really weird because it only happens on subdomains, subfolders are not affected. I am using your htaccess code and made a folder accesible by test.example.com and example.com/test. Only on test.example.com I get the weird characters. And I am using a blanco copy of CI. It seems to be a problem on CI their side as I did not modify anything else except for setting the htaccess you provided me.
Reply
#16

My own site uses several subdomains, but, as I said, I've had to modify my .htaccess rules for every environment. I'm pretty sure the biggest difference between a site with a subdomain vs. a subfolder would be to remove or modify the RewriteBase line, but there could be some other modifications I'm not thinking of at the moment.
Reply
#17

Thanks for your reply! I spent some hours figuring out what was going on. It appeared to be GZIP compression being a bad guy here. When I disable GZIP it works perfectly and throws in an 403 - Forbidden page.

On the other hand, when GZIP is enabled it throws in these weird symbols instead...

Have you got any idea how I can enable GZIP while having the 403 - Forbidden document to be displayed? Or have you got any idea I can hide the location to this /applications folder in general so the user doesn't have any idea there's a folder behind that url?

Thanks for your continued support !!
Reply
#18

Generally, I keep my application/system/etc. directories outside of my public directory, so I just get a 404 from /application.

Where is the 403 message coming from in your case? Is it part of your rewrite rules, or is it serving up the index.html page in the application directory?

I'm not sure why the compression would fail in one case and not in the other.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB