0

I've checked an issue on my wordpress. When browsing the domain page root https://domain1.com if adding a trailing slash at the end, like this https://domain1.com/ it gives a blank page. If removing the trailing slash, it opens fine. Any fix for this ?

On the other hand, if opening any page without trailing slash, I have a blank page. Example: https://domain1.com/page1 but if I add an ending slash it opens fine, like this: https://domain1.com/page1/

I'm sure this can be fixed with a correct .htaccess file, just not sure which settings.

This is what I have:

RewriteEngine on

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Thanks for your help!

GF1
  • 1
  • 2

1 Answers1

0

Nevermind, solved. This is how I did: Added a error log file recording on my htaccess:

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /home/myuser/public_html/PHP_errorsX1.log

# prevent access to PHP error log
<Files PHP_errorsX1.log>
Order allow,deny
Deny from all
Satisfy All
</Files>

Then, checked error log. It shown some error on functions.php file:

[21-Oct-2018 14:54:05 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/myuser/public_html/wp-content/themes/mytheme/functions.php:84) in /home/myuser/public_html/wp-includes/pluggable.php on line 1210

Checked that specific line, and it was a damn blank line on the bottom of the file after closing php code. Deleted that file and all is back good now, including some stupid random blank page errors on my WP ADMIN I was getting.

GF1
  • 1
  • 2