PDA

View Full Version : Need some help on htaccess and admincp


pityocamptes
02-23-2014, 11:26 PM
Well I added this to increase load speed, which it did for my site. However, while trying to get into my admincp it accepts the pw but brings me right back to the login box... big loop, never lets me in. Did I do something wrong on the htaccess? Thanks.

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/javascript A604800
ExpiresByType application/x-javascript A604800
ExpiresByType text/javascript A604800
ExpiresByType text/css A604800
ExpiresByType image/gif A604800
ExpiresByType image/x-icon A604800
ExpiresByType image/icon A604800
ExpiresByType image/jpg A604800
ExpiresByType image/jpeg A604800
ExpiresByType image/png A604800
ExpiresByType text/html A604800
</IfModule>

# BEGIN Caching
<ifModule mod_headers.c>
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>
# END Caching

ozzy47
02-23-2014, 11:31 PM
So if you remove that from the htaccess you are able to get into the ACP with no issues?

Where did you get this code to add there?

pityocamptes
02-23-2014, 11:41 PM
So if you remove that from the htaccess you are able to get into the ACP with no issues?

Where did you get this code to add there?

Looked around the internet, why do you have something better, or is it not a good option?

Didn't seem to make a difference... hells bells... maybe it takes a while for htaccess to update on the server?

ozzy47
02-23-2014, 11:44 PM
No, if you removed the code from the htaccess, and still can not access the ACP, you got something else going on.

Open your includes/config.php file and below<?php add this line:

define('DISABLE_HOOKS', true);

So it looks like this:
<?php
define('DISABLE_HOOKS', true);
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 4.2.2


Then see if you can access the ACP

ozzy47
02-23-2014, 11:47 PM
Absolutely you can increase your page speed via htaccess.

Lynne
02-23-2014, 11:57 PM
I'm no expert in .htaccess, but I don't think that is the problem as you are re-validating for php files. I would do as Ozzy47 suggested and disable your plugins.

pityocamptes
02-23-2014, 11:58 PM
Odd, works fine in IE but not FF... will try the hooks thing...

I see you can DEFLATE via htaccess, what exactly does that do? Thanks.

ozzy47
02-23-2014, 11:59 PM
One thing at a time, lets get you into the ACP first.

pityocamptes
02-23-2014, 11:59 PM
Nope, the hooks thing did not work...

I can get in fine in IE, just not FF and I cleared all cookies, cache in FF..

ozzy47
02-24-2014, 12:00 AM
Ok since it only seems to be FF, have you cleared your cookies and cache in the browser?

Lynne
02-24-2014, 12:00 AM
It works in firefox? How about logging out of the site, clearing your cookies AND browser history and then trying to login.

pityocamptes
02-24-2014, 12:05 AM
Very strange... closed browser, cleared cache and cookies, opened back up and still can't get in...

ozzy47
02-24-2014, 12:05 AM
OK Pm me a admin account and I will see if I can replicate the issue. Make sure you removed all the code from the .htaccess.

pityocamptes
02-24-2014, 12:10 AM
OK Pm me a admin account and I will see if I can replicate the issue. Make sure you removed all the code from the .htaccess.

Sent

ozzy47
02-24-2014, 12:25 AM
When did you notice this start happening? What browser do you use by default?

I was able to replicate the issue, both logging into the ACP and the site it's self, but then I cleared my cookies for your site, and was able to log in successfully.

pityocamptes
02-24-2014, 12:29 AM
When did you notice this start happening? What browser do you use by default?

I was able to replicate the issue, both logging into the ACP and the site it's self, but then I cleared my cookies for your site, and was able to log in successfully.

After I did the second part of the htaccess, I use FF by default :

# BEGIN Caching
<ifModule mod_headers.c>
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>
<filesMatch "\\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
</ifModule>
# END Caching

ozzy47
02-24-2014, 12:32 AM
OK, so your htacess is completely empty now?

Is there a specific reason you have installed a SSL, and are using https instead of http for the site?

Your MGC chatbox is not working, I would disable that.

Max Taxable
02-24-2014, 01:17 AM
If you're trying to use htaccess to cache static content, it's not working.

WebPageTest (http://www.webpagetest.org/result/140224_2A_1ZY/)

I see you're also ineptly trying to use cloudflare as a CDN, this overrides any caching you try to do via htaccess.

pityocamptes
02-24-2014, 02:10 AM
If you're trying to use htaccess to cache static content, it's not working.

WebPageTest (http://www.webpagetest.org/result/140224_2A_1ZY/)

I see you're also ineptly trying to use cloudflare as a CDN, this overrides any caching you try to do via htaccess.

Not sure I understand what you mean by cloudflare? Can you use htaccess to cache static content? Am I doing it wrong? Thanks.

ozzy47
02-24-2014, 02:24 AM
OK, so your htacess is completely empty now?

Is there a specific reason you have installed a SSL, and are using https instead of http for the site?

Your MGC chatbox is not working, I would disable that.

What about this.

pityocamptes
02-24-2014, 02:29 AM
Was able to get in now.

Had the SSL, and decided to use it. Still good for another year (two years at the time of update)...

Chatbox works, just loads collapsed.

--------------- Added 1393214271 at 1393214271 ---------------

If you're trying to use htaccess to cache static content, it's not working.

WebPageTest (http://www.webpagetest.org/result/140224_2A_1ZY/)

I see you're also ineptly trying to use cloudflare as a CDN, this overrides any caching you try to do via htaccess.

Max, for some reason when I run that test in any other browser but IE 10 [IE 11shows a huge jump] it does not show such crappy numbers... in fact down to 8.6 sec and 688 bytes... [IE 11]...

--------------- Added 1393219033 at 1393219033 ---------------

Without getting too much off topic, before I download this, is it worth it?

https://vborg.vbsupport.ru/showthread.php?t=266696

Max Taxable
02-26-2014, 12:32 AM
Max, for some reason when I run that test in any other browser but IE 10 [IE 11shows a huge jump] it does not show such crappy numbers... in fact down to 8.6 sec and 688 bytes... [IE 11]...Other browsers such as FF ignore a good many page elements if they have errors or otherwise won't load. That's why they are faster browsers than IE. It is NOT a true test to test with those other browsers, you're not getting the real picture.

I use the IE 10 test at WebPageTest because IE 10 and 11 are the standard to test to, for supporting the new browsers. If you get those tests good, all the rest of the tests are that much better.

You want to "test shop" you don't really want to fix your problems. To operate scientifically, you stick with ONE baseline test and not a scattershot of other tests, muddying the waters.

It's nonsensical to change the parameters of the test to show better results when those better results simply do not exist. It's the same as if I ran your site test with DSL or Dialup connection then tried to claim it was worse. See?

Here's your current test with the correct parameters, IE 10 and a fast cable connection out of Dulles Va.: WebPageTest (http://www.webpagetest.org/result/140226_BR_1QV/)

Here's your site tested with a DSL connection, for "test shopping" reference: DSLWebPageTest. (http://www.webpagetest.org/result/140226_9R_23K/)

And you're STILL not testing worth a crap even on Firefox browser with fast cable connection. See all those F grades?

Can you use htaccess to cache static content? Am I doing it wrong?That's the ONLY reason the code you posted would exist, to try to cache static content. You copied it directly off my article about it on OzzModz. Did you not also read the article?

On your htaccess - did you finally realize you needed to put a dot before the filename? It is .htaccess not, just htaccess. It won't have any effect without the dot.

The effort you are putting in is fruitless because you are not approaching this with a scientific mindset, and you are not using the resources the WebPageTest site provides. Again, see all the F grades? Click on those and read up, the site TELLS you what you need to do to fix the issues. It's not like it's any mystery or a guessing game, they lay it out for you specifically.

RichieBoy67
02-26-2014, 04:25 AM
Other browsers such as FF ignore a good many page elements if they have errors or otherwise won't load. That's why they are faster browsers than IE. It is NOT a true test to test with those other browsers, you're not getting the real picture.

I use the IE 10 test at WebPageTest because IE 10 and 11 are the standard to test to, for supporting the new browsers. If you get those tests good, all the rest of the tests are that much better.

You want to "test shop" you don't really want to fix your problems. To operate scientifically, you stick with ONE baseline test and not a scattershot of other tests, muddying the waters.

It's nonsensical to change the parameters of the test to show better results when those better results simply do not exist. It's the same as if I ran your site test with DSL or Dialup connection then tried to claim it was worse. See?

Here's your current test with the correct parameters, IE 10 and a fast cable connection out of Dulles Va.: WebPageTest (http://www.webpagetest.org/result/140226_BR_1QV/)

Here's your site tested with a DSL connection, for "test shopping" reference: DSLWebPageTest. (http://www.webpagetest.org/result/140226_9R_23K/)

And you're STILL not testing worth a crap even on Firefox browser with fast cable connection. See all those F grades?

That's the ONLY reason the code you posted would exist, to try to cache static content. You copied it directly off my article about it on OzzModz. Did you not also read the article?

On your htaccess - did you finally realize you needed to put a dot before the filename? It is .htaccess not, just htaccess. It won't have any effect without the dot.

The effort you are putting in is fruitless because you are not approaching this with a scientific mindset, and you are not using the resources the WebPageTest site provides. Again, see all the F grades? Click on those and read up, the site TELLS you what you need to do to fix the issues. It's not like it's any mystery or a guessing game, they lay it out for you specifically.

Hey Max, I would love to read that article. Could you post the link to it please?

I have been wanting to to better with static image loading. I figured I would be ok just using nginx but apparently I still need to set expiration times, etc. At any rate I would love to see your article and also I would be interested to see the portions of your htaccess that are relevant to caching, etc.

Thanks

pityocamptes
02-28-2014, 03:21 AM
Other browsers such as FF ignore a good many page elements if they have errors or otherwise won't load. That's why they are faster browsers than IE. It is NOT a true test to test with those other browsers, you're not getting the real picture.

I use the IE 10 test at WebPageTest because IE 10 and 11 are the standard to test to, for supporting the new browsers. If you get those tests good, all the rest of the tests are that much better.

You want to "test shop" you don't really want to fix your problems. To operate scientifically, you stick with ONE baseline test and not a scattershot of other tests, muddying the waters.

It's nonsensical to change the parameters of the test to show better results when those better results simply do not exist. It's the same as if I ran your site test with DSL or Dialup connection then tried to claim it was worse. See?

Here's your current test with the correct parameters, IE 10 and a fast cable connection out of Dulles Va.: WebPageTest (http://www.webpagetest.org/result/140226_BR_1QV/)

Here's your site tested with a DSL connection, for "test shopping" reference: DSLWebPageTest. (http://www.webpagetest.org/result/140226_9R_23K/)

And you're STILL not testing worth a crap even on Firefox browser with fast cable connection. See all those F grades?

That's the ONLY reason the code you posted would exist, to try to cache static content. You copied it directly off my article about it on OzzModz. Did you not also read the article?

On your htaccess - did you finally realize you needed to put a dot before the filename? It is .htaccess not, just htaccess. It won't have any effect without the dot.

The effort you are putting in is fruitless because you are not approaching this with a scientific mindset, and you are not using the resources the WebPageTest site provides. Again, see all the F grades? Click on those and read up, the site TELLS you what you need to do to fix the issues. It's not like it's any mystery or a guessing game, they lay it out for you specifically.


I have been trying to do what it says, somethings are way over my head. It speaks of sprites and other stuff. I shrunk all the images as far as I could, as you recommend. I don't really know how to implement the other things. Trust me, I have been searching for hours on the web...