• Resolved cueb

    (@cueb)


    Hello,

    I disabled the WP-Optimize plugin and got stuck in a server 500 Error.
    It could be that the .htaccess file still contains code related to the plugin that could cause this issue.
    The error log shows …wordpress/.htaccess: Invalid command ‘application/schema+json’, and my provider was telling me that it might be misspelled or defined by a module not included in the server configuration which could be the disabled WP-Optimize plugin.

    I had a look in the .htaccess file but I have no idea what exactly I would have to comment out to resolve this issue. I tried just the 2 lines including “schema+json“ with no success.

    Is there a way to tell what lines belong to WP-Optimize and could they be safely removed?

    Thank you for any information you can provide.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter cueb

    (@cueb)

    SOLVED IT:

    For those having similar issues…

    I disabled the plugin folder by renaming it and made a copy of the .htaccess on the desktop and deleted the .htaccess on the server.
    After deleating the .htaccess I could access the dashboard again and rewrite a fresh .htaccess by visiting the dashboard, settings, permalink, save changes.

    Then it was just a copy paste back and forth to find out which line was conflicting and causing the 500 server error. It was just one line that had to be commented out.
    # “application/manifest+json” \

    It wasn’t even the lines that were indicated by the server error log (schema+json). I could leave both lines of this type in the file without a problem.

    Hope that helps someone facing similar issues when deactivating “WP-Optimize” and facing a server 500 Error.

    Plugin Contributor Venkat Raj

    (@webulous)

    @cueb Glad to hear that you solved the issue. Ideally, WPO remove all the changes it made when disabled. I have added the issue to our to do list to do the investigation.

    Thanks for reporting this.

    Plugin Contributor Venkat Raj

    (@webulous)

    @cueb How do you come to conclusion that WP Optimize added that line? Does deleting .htaccess file and re-enabling WP Optimize added that line?

    WPO uses .htaccess file to add rules for enabling browser cache and gzip compression serving. None of these rules have the line you have mentioned.

    Could you please clarify?

    Thread Starter cueb

    (@cueb)

    Hello Venkat Raj,

    thank you for your reply.

    The only connection that I can draw is that I disabled the plugin and immediately after it got the 500 Server Error.

    I read another support thread where somebody asked if it is safe to remove the code of WP-Optimize in the .htaccess file because the plugin was not installed after switching the server/provider which resultet in a 500 server error. I compared the lines with my .htaccess file, trying to figure out what belongs to the plugin and what not.

    The troubeling line (“application/manifest+json” \) is included in this section:

    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    	
    # Compress all output labeled with one of the following media types.
    #
    # (!) For Apache versions below version 2.3.7 you don't need to
    # enable <code>mod_filter</code> and can remove the <code><IfModule mod_filter.c></code>
    # and <code></IfModule></code> lines as <code>AddOutputFilterByType</code> is still in
    # the core directives.
    #
    # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    	
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE "application/atom+xml" \
    		"application/javascript" \
    		"application/json" \
    		"application/ld+json" \
    		"application/manifest+json" \
    		"application/rdf+xml" \
    		"application/rss+xml" \
    		"application/schema+json" \
    		"application/vnd.geo+json" \
    		"application/vnd.ms-fontobject" \
    		"application/x-font-ttf" \
    		"application/x-javascript" \
    		"application/x-web-app-manifest+json" \
    		"application/xhtml+xml" \
    		"application/xml" \
    		"font/eot" \
    		"font/opentype" \
    		"image/bmp" \
    		"image/svg+xml" \
    		"image/vnd.microsoft.icon" \
    		"image/x-icon" \
    		"text/cache-manifest" \
    		"text/css" \
    		"text/html" \
    		"text/javascript" \
    		"text/plain" \
    		"text/vcard" \
    		"text/vnd.rim.location.xloc" \
    		"text/vtt" \
    		"text/x-component" \
    		"text/x-cross-domain-policy" \
    		"text/xml"
    		
    	</IfModule>

    —–

    After forcing a .htaccess rewrite with permalink, save changes the htaccess file was the clean WP-Setup without any extras.

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    	RewriteBase /wordpress/
    	RewriteRule ^index\.php$ - [L]
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule . /wordpress/index.php [L]
    </IfModule>
    
    # END WordPress

    —-

    After this I added section for section and line for line in the part, that was causing the issue, until it was clear that the only line causing the problem was:
    “application/manifest+json” \

    I removed it and now everything seems to work as before.

    All I did was trial and error.
    If this is actually added through WP-Optimize or not is beyond my capacity to judge.

    —-

    And all of this still leaves me with my original issue / question that lead me to disable WP-Optimize in the first palce. And that is why parts of my Uncode Site won’t display large font size text sections on mobile that display correctly on desktop?
    I found this quote in the support forum as a description for a possible cause:
    “The problem is with your Optimization setting, Exclude jquery and jQuery migrate from defer parsing.”

    Could it be WP-Optimize that is causing this issue?

    Best,
    Chris

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Removing WP_Optimize Info from .htaccess’ is closed to new replies.