Maxen
Forum Replies Created
-
“I an more wondering the 404 case, and please share me the full content of it” – I did not catсh same bug while testing on stage environment so I doubt it will help you at this stage.
Thanks for your help, issue resolved.
Right placement of custom rule – after closing LS comment:
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteRule .? - [E=Cache-Vary:city]Result – rule applied, pages cached separately based on given cookie value, no 404 errors on pages.
Ok.
Case #1. Rule added to WordPress section:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteRule .? - [E=Cache-Vary:city] </IfModule> # END WordPressResult – rule not applied.
Case #2. Rule added to end of file:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteRule .? - [E=Cache-Vary:city]Result – rule not applied.
Case #3. Rule putted right after LS closing comment:
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteRule .? - [E=Cache-Vary:city]Result – rule applied, pages cached separately based on given cookie value, no 404 errors on pages.
404 error on every website page sound’s not “bad” enough?
“no , if you put it into of this block , it will be overridden when you save plugin’s setting” – yes, I know, that’s why I opened this topic, to get safe method of keeping this rule inside. And when this string is putted outside all wordpress rules get wiped on enabling / disabling debug mode.
So the question is, where exactly this string should be put if there is no other option to ensure safe keeping this string into LS configuration?
Putting this rule outside of its tag leads only to not working website, as all WordPress data in .htaccess is destroyed.
More than that, as I read before, there was an instruction to use this string INSIDE this module.
So putting LS specific rule outside of IfModule LiteSpeed tag ends bed.
<IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule .? - [E=Cache-Vary:city] RewriteRule .litespeed_conf.dat - [F,L]Forum: Plugins
In reply to: [Oxygen Tutor LMS] Dashboard links doesn’t workI feel your pain. If question still bothering you I have found workaround: https://ww.wp.xz.cn/support/topic/dashboard-endpoints-not-working-with-oxygen-builder/
In case support will not give better fix for Oxygen Builder users, what worked for me:
1. Change your profile page slug to
/dashboard, it must stop redirects to home page if you have them.2. Create separate Oxygen template for profile pages. It must contain code block where you will insert custom php code.
3. Copy code of
tutor/templates/dashboard/index.phptemplate to your code block.4. Our problem lies in empty variables
$dashboard_page_slugand$dashboard_page_name. As a result add code/** * Fixes to not working Tutor code for Oxygen */ $mxn_base = '/dashboard'; $mxn_url_clear = str_replace("/", "",str_replace($mxn_base, "",trim(strtok($_SERVER['REQUEST_URI'], '?')))); $dashboard_page_slug = $mxn_url_clear; $dashboard_page_name = $mxn_url_clear;after line 25.
5. Create needed pages similar to Tutor Dashboard links and assign your Oxygen template to them.
As a result template will take variables from link, and pages will load correctly. Biggest minus for this – we need to create all those pages and links must match with tutors menu in dashboard.
- This reply was modified 5 years, 3 months ago by Maxen.
First of all, when we are setting dashboard page slug in wp to
/dashboardproblem with redirects to homepage goes away. Links finally start to load correctly.It means I can create all dashboard subpages and insert needed php template, at least, or use Oxygen template.
And, as far as I see, your problem lies here:
if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) { $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page']; $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page']; } else { $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page']; $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page']; }Your variables
$dashboard_page_slugand$dashboard_page_nameare empty as a result…I see you are using
tutor_load_template("dashboard.dashboard");to load needed php template to current page.It means than somehow, all that is wrong is page which we are loading in result, because I am redirected to home page all the times… If we are redirected to dashboard page, and you can pass subpage slug, we will have same page with working dashboard…
And it means that our setting of Dashboard page in Tools just don’t work properly.
Again, when I am pasting endpoint php code to separate page and run it, it working.
It seems we need additional template whitch will catch all dashboard endpoints and outputs their php code in some container.