Error on Custom Content Directory




Wordpress LScache Plugin: Error on Custom Content Directory


Hello, We have come accross an issue if a site is used in a custom directory. 2 issues have appeared. Let me give you some background first: We use ithemes custom login url option. after enabling your litespeed cache plugin and configuring then loggin out we were not able to login using the custom url. It gave a 404 page. After a bit of investigating we found that the .htaccess that was getting updated was the one in the custom content folder specified where core WP files would reside and NOT the root .htaccess That also explins why we were getting very poor results and page speed scores. here is the code thats being used in wp-config to specif a custom content directory for plugins and themes AND for the WP core files: // ======================== // Custom Content Directory // ======================== define( WP_CONTENT_DIR, dirname( __FILE__ ) . /FOLDERNAME ) define( WP_CONTENT_URL, https://domainname.com/FOLDERNAME ) / Absolute path to the WordPress directory. / if ( !defined(ABSPATH) ) define(ABSPATH, dirname(__FILE__) . /FOLDERNAME/) So the 2 issues are: 1. the custom login url specified by ithemes breaks (due to the wrong htaccess file being upadted). 2. Wrong htaccess being used NOT the one in root Because of all this one is not able to login when the plugin is enabled AND the page speed scores are very poor. FYI, wp rocket doesnt have this issues and works as expected. Updates the root htaccess as it should and allows you to login via custom login url. We have multiple sites on a litespeed server and want to benefit from the plugin too BUT all have the custom directories specified SO the plugin wont work as exected? Can you advise and provide a fix???? how exactly is your site structure ? like you set URL to / , but the files are inside of other directory like /wp/ ? @CacheCrawler do you mean the URL setting on th general settings page? if so the home url would be: https://domainname.com and wp location set too: https://domainname.com/wp then ALL the core WP files are stored in the /wp/ folder AND any theme/plugin files in its own respective folder (lets just say FILES folder for arguments sake). So folder stucture would be like so: Root folder > htaccess > wp-config >WP FOLDER >> core files > FILES FOLDER >> themes folder >>> strefront theme >> PLUGIN FOLDER >>> litespeed plugin Hope that makes sense. please try this : 1. disable LSCWP , and make sure everything works , if you cant login , you can directly by re-name the LSCWP directory in file system , that will forcefully disengage LSCWP from wp 2. add following 2 lines into your wp-config.php defined( LITESPEED_CFG_HTACCESS ) || define( LITESPEED_CFG_HTACCESS , /home/user/public_html/.htaccess ) defined( LITESPEED_CFG_HTACCESS_BACKEND ) || define( LITESPEED_CFG_HTACCESS_BACKEND , /home/user/public_html/wp/.htaccess ) change the path accordingly to your server 3. now re-enable or re-install LSCWP , see how it goes @CacheCrawler thanks for the super quick replies! Will give your instructions a go and test test test? hopefully it will fix the issues. Hopeing we can get it to perform better than wpr which failing to get above 85 for the home page! Will post an update soon either way @CacheCrawler so an update. Have been having problems with the site an host which has taken a day or so to sort out and with some super helpful support and advice we have got that fixed and with your code snippets implemented we have now got litespeed working using the correct htaccess AND score are flying! 44ms TTFB, 95+ pagespeed scores! Brilliant. Beats the pants off WPR BUT cannot login to the configured backend URL set via ithemes plugin. Simply get a 404 not found litespeed page Turning off litespeed we are again able to access the backend admin. Turned ON we are not able to access Is there somewhere in the litespeed settings where we need to specify the login url? OR other setting/snippet we need add/adjust? please create a ticket by mail to support at litespeedtech.com with reference link to this topic we will investigate further. Hello, A quick update, still waiting on support to get back to me and in the mean time I have been testing. What I found is that the custom directory where the core WP files are stored, litespeed cache updated that .htaccess despite adding in the 2 lines you gave to add to wp-config file? I manually deleted those lines and am now able to access the ustom admin url. Also cleared and purged the litespeed cache a few times and this has not resulted in that htaccess file being upadted again with litespeed cache values? Not entirely sure IF that had a negative impact on speed and page speed scores as running tests gives mixed results each and every time? Not consitient at all. Will keep monitoring it and await a reply from support BUT thought I may as well post an update here too? Hi, its weekend , so thing may move bit of slower someone should have contacted you today best regards, @CacheCrawler yup, thanks for updae. Got an email from support. Asking to create a site clone. Not sure how practicle thats going to be OR how quick we can getthat done considering it needs to be done on the same platform as the live site.. Have a dev install BUt its not on the same platform? On another note. We removed this line: defined( LITESPEED_CFG_HTACCESS_BACKEND ) || define( LITESPEED_CFG_HTACCESS_BACKEND , /home/user/public_html/wp/.htaccess ) and since then we havent had issue in logging into the backend using the custom url we have? Only downside seems to be the site goes to sleep quite often AND not getting great pagespeed results as before. Not sure if removing that line is the cause? what do you mean by goes to sleep ? @CacheCrawler so as an example if we do a page speed test with any of the services i.e. google pagespeed, gtmetrix etc the scores are super poor.. however on the second run they are back up and pretty good. Its like the sites been asleep and the first test (from any service) wakes it up and gives a result (really poor) whereby the secon test as sites alread awake the scores jump back up into the good/great range? Thats a=what I meant. Hoep that makes sense? okay , you refer to cache miss and cache hit case maybe you can check this page @CacheCrawler thanks for the quick update. I will check that link and do some test. Hoping that will identify the issue and we can fix Thank you.
Do you need help?
We are online almost any time and ready to answer any question. The answer to your question will come faster than it takes you to release the mouse button.

Ask A Question