Errors when site moved to new server

Need help with the Administration of your Joomla! 4.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
ukfish1
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Thu Jan 12, 2012 3:59 pm

Errors when site moved to new server

Post by ukfish1 » Tue Mar 26, 2024 3:28 pm

The following site has recently been moved over to a new server by the migration team at TSOHost

www.midsurreybowls.co.uk

The site was not displaying correctly at all. This is what tech support at TSOHost said

DNS is pointing to the new server and the site is at least loading for me, though I can see that links are not working and there are a number of errors in the browser console, mainly relating to .js and .css files. I believe this may be an issue with Gzip compression as commenting out the following from .htaccess does at least seem to improve it:

RewriteCond "%{HTTP:Accept-encoding}" "gzip"
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
RewriteRule "^(.*)\.js" "$1\.js\.gz"

As it happens, mod_deflate was not already installed on the server so I do not believe that Gzip could have worked properly anyway. However, installing this has not made any difference and some of the other directives to enable it are missing from .htaccess. So potentially it is not so much Gzip that is to blame as it is the .htaccess file.

I have left the lines commented out for now but I would recommend going over this with your developer to make sure that there are no errors.

The admin section at www.midsurreybowls.co.uk/administrator is not displaying correctly at all and email links are not working (Email us at This email address is being protected from spambots. You need JavaScript enabled to view it.)

Regards

Paul

gws
Joomla! Champion
Joomla! Champion
Posts: 5952
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Errors when site moved to new server

Post by gws » Tue Mar 26, 2024 4:41 pm

That looks like the double zip problem?
post the FPA please, read the docs first. https://forumpostassistant.github.io/docs/
Check this https://googlechrome.github.io/lighthou ... chrome-ext#

ukfish1
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Thu Jan 12, 2012 3:59 pm

Re: Errors when site moved to new server

Post by ukfish1 » Thu Mar 28, 2024 9:25 am

Forum Post Assistant (v1.6.6) : 28-Mar-2024 wrote:
Basic Environment :: wrote:Joomla! Instance :: Joomla! 4.3.1-Stable (Bora) 2-May-2023
Joomla! Configured :: Yes | Read-Only (444) |
Configuration Options :: Offline: false | SEF: true | SEF Suffix: false | SEF ReWrite: true | .htaccess/web.config: Yes | GZip: true | Cache: false | CacheTime: 15 | CacheHandler: file | CachePlatformPrefix: false | FTP Layer: N/A | Proxy: false | LiveSite: | Session lifetime: 15 | Session handler: database | Shared sessions: false | SSL: 2 | Error Reporting: none | Site Debug: false | Language Debug: false | Default Access: Public | Unicode Slugs: false | dbConnection Type: mysqli | PHP Supports J! 4.3.1: Yes | Database Supports J! 4.3.1: Yes | Database Credentials Present: Yes |

Host Configuration :: OS: Linux | OS Version: 4.18.0-513.11.1.el8_9.x86_64 | Technology: x86_64 | Web Server: Apache | Encoding: gzip, deflate | System TMP Writable: Yes | Free Disk Space : 686.15 GiB |

PHP Configuration :: Version: 8.1.27 | PHP API: fpm-fcgi | Session Path Writable: Yes | Display Errors: 0 | Error Reporting: 32759 | Log Errors To: /home/mid2/logs/midsurreybowls_co_uk.php.error.log | Last Known Error: 20th March 2023 10:26:38. | Register Globals: | Magic Quotes: | Safe Mode: | Allow url fopen: 1 | Open Base: | Uploads: 1 | Max. Upload Size: 512M | Max. POST Size: 8M | Max. Input Time: 60 | Max. Execution Time: 30 | Memory Limit: 128M

Database Configuration :: Version: 8.0.36 (Client:mysqlnd 8.1.27) | Database Size: 11.48 MiB | #of Tables with config prefix:  78 | #of other Tables:  0 | User Privileges : GRANT ALL
Detailed Environment :: wrote:PHP Extensions :: Core (8.1.27) | date (8.1.27) | libxml (8.1.27) | openssl (8.1.27) | pcre (8.1.27) | zlib (8.1.27) | filter (8.1.27) | hash (8.1.27) | json (8.1.27) | pcntl (8.1.27) | Reflection (8.1.27) | SPL (8.1.27) | session (8.1.27) | standard (8.1.27) | cgi-fcgi (8.1.27) | bcmath (8.1.27) | calendar (8.1.27) | ctype (8.1.27) | curl (8.1.27) | dom (20031129) | ftp (8.1.27) | gd (8.1.27) | iconv (8.1.27) | imap (8.1.27) | mbstring (8.1.27) | mysqlnd (mysqlnd 8.1.27) | PDO (8.1.27) | Phar (8.1.27) | posix (8.1.27) | SimpleXML (8.1.27) | sockets (8.1.27) | sqlite3 (8.1.27) | tokenizer (8.1.27) | xml (8.1.27) | xmlwriter (8.1.27) | xsl (8.1.27) | zip (1.19.5) | mysqli (8.1.27) | pdo_mysql (8.1.27) | pdo_sqlite (8.1.27) | xmlreader (8.1.27) | Zend Engine (4.1.27) |
Potential Missing Extensions :: fileinfo |
Disabled Functions :: exec | passthru | shell_exec | system |

Switch User Environment :: PHP CGI: Yes | Server SU: No | PHP SU: Yes | Potential Ownership Issues: No
Folder Permissions :: wrote:Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (755) | tmp/ (755) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) | administrator/logs/ (755) | api/ (755) |

Elevated Permissions (First 10) ::
Database Information :: wrote:Database statistics :: Uptime: 2950704 | Threads: 2 | Questions: 64725421 | Slow queries: 18 | Opens: 4496319 | Flush tables: 3 | Open tables: 4000 | Queries per second avg: 21.935 |
Extensions Discovered :: wrote:Components :: Site ::
Core ::
3rd Party::

Components :: Admin ::
Core :: com_actionlogs (3.9.0) 1 | com_admin (4.0.0) 1 | com_ajax (4.0.0) 1 | com_associations (4.0.0) 1 | com_banners (4.0.0) 1 | com_cache (4.0.0) 1 | com_categories (4.0.0) 1 | com_checkin (4.0.0) 1 | com_config (4.0.0) 1 | com_content (4.0.0) 1 | com_contenthistory (4.0.0) 1 | com_cpanel (4.0.0) 1 | com_fields (4.0.0) 1 | com_finder (4.0.0) 1 | com_guidedtours (4.3.0) 1 | com_installer (4.0.0) 1 | com_joomlaupdate (4.0.3) 1 | com_languages (4.0.0) 1 | com_login (4.0.0) 1 | com_mails (4.0.0) 1 | com_media (3.0.0) 1 | com_menus (4.0.0) 1 | com_messages (4.0.0) 1 | com_modules (4.0.0) 1 | com_newsfeeds (4.0.0) 1 | com_plugins (4.0.0) 1 | com_postinstall (4.0.0) 1 | com_privacy (3.9.0) 1 | com_redirect (4.0.0) 1 | com_scheduler (4.1.0) 1 | com_tags (4.0.0) 1 | com_templates (4.0.0) 1 | com_users (4.0.0) 1 | com_workflow (4.0.0) 1 | com_wrapper (4.0.0) 1 |
3rd Party:: COM_CONVERTFORMS (3.2.11) 1 | com_widgetkit (3.1.14) 1 |

Modules :: Site ::
Core :: mod_articles_archive (3.0.0) 1 | mod_articles_categories (3.0.0) 1 | mod_articles_category (3.0.0) 1 | mod_articles_latest (3.0.0) 1 | mod_articles_news (3.0.0) 1 | mod_articles_popular (3.0.0) 1 | mod_banners (3.0.0) 1 | mod_breadcrumbs (3.0.0) 1 | mod_custom (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_finder (3.0.0) 1 | mod_footer (3.0.0) 1 | mod_languages (3.5.0) 1 | mod_login (3.0.0) 1 | mod_menu (3.0.0) 1 | mod_random_image (3.0.0) 1 | mod_related_items (3.0.0) 1 | mod_stats (3.0.0) 1 | mod_syndicate (3.0.0) 1 | mod_tags_popular (3.1.0) 1 | mod_tags_similar (3.1.0) 1 | mod_users_latest (3.0.0) 1 | mod_whosonline (3.0.0) 1 | mod_wrapper (3.0.0) 1 |
3rd Party:: mod_convertforms (1.0) 1 | Hot Joomla Carousel (3.9.0) 1 | Hot Maps (3.5.1) 1 | Hot Responsive Lightbox (3.9.0) 1 | Hot Slicebox (3.6.5) 1 | Hot Swipe Carousel (4.2.0) 1 | Widgetkit (3.1.14) 1 |

Modules :: Admin ::
Core :: mod_custom (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_frontend (4.0.0) 1 | mod_guidedtours (4.3.0) 1 | mod_latest (3.0.0) 1 | mod_latestactions (3.9.0) 1 | mod_logged (3.0.0) 1 | mod_login (3.0.0) 1 | mod_loginsupport (4.0.0) 1 | mod_menu (3.0.0) 1 | mod_messages (4.0.0) 1 | mod_multilangstatus (3.0.0) 1 | mod_popular (3.0.0) 1 | mod_post_installation_messages (4.0.0) 1 | mod_privacy_dashboard (3.9.0) 1 | mod_privacy_status (4.0.0) 1 | mod_quickicon (3.0.0) 1 | mod_sampledata (3.8.0) 1 | mod_stats_admin (3.0.0) 1 | mod_submenu (3.0.0) 1 | mod_title (3.0.0) 1 | mod_toolbar (3.0.0) 1 | mod_user (4.0.0) 1 | mod_version (3.0.0) 1 |
3rd Party::

Libraries ::
Core ::
3rd Party::

Plugins ::
Core :: plg_actionlog_joomla (3.9.0) 1 | plg_api-authentication_basic (4.0.0) 0 | plg_api-authentication_token (4.0.0) 1 | plg_authentication_cookie (3.0.0) 1 | plg_authentication_joomla (3.0.0) 1 | plg_authentication_ldap (3.0.0) 0 | plg_behaviour_taggable (4.0.0) 1 | plg_behaviour_versionable (4.0.0) 1 | plg_captcha_recaptcha (3.4.0) 1 | plg_captcha_recaptcha_invisible (3.8) 0 | plg_content_confirmconsent (3.9.0) 0 | plg_content_emailcloak (3.0.0) 1 | plg_content_fields (3.7.0) 1 | plg_content_finder (3.0.0) 1 | plg_content_joomla (3.0.0) 1 | plg_content_loadmodule (3.0.0) 1 | plg_content_pagebreak (3.0.0) 1 | plg_content_pagenavigation (3.0.0) 1 | plg_content_vote (3.0.0) 1 | plg_editors-xtd_article (3.0.0) 1 | plg_editors-xtd_fields (3.7.0) 1 | plg_editors-xtd_image (3.0.0) 1 | plg_editors-xtd_menu (3.7.0) 1 | plg_editors-xtd_module (3.5.0) 1 | plg_editors-xtd_pagebreak (3.0.0) 1 | plg_editors-xtd_readmore (3.0.0) 1 | plg_extension_finder (4.0.0) 1 | plg_extension_joomla (3.0.0) 1 | plg_extension_namespacemap (4.0.0) 1 | plg_fields_calendar (3.7.0) 1 | plg_fields_checkboxes (3.7.0) 1 | plg_fields_color (3.7.0) 1 | plg_fields_editor (3.7.0) 1 | plg_fields_imagelist (3.7.0) 1 | plg_fields_integer (3.7.0) 1 | plg_fields_list (3.7.0) 1 | plg_fields_media (3.7.0) 1 | plg_fields_radio (3.7.0) 1 | plg_fields_sql (3.7.0) 1 | plg_fields_subform (4.0.0) 1 | plg_fields_text (3.7.0) 1 | plg_fields_textarea (3.7.0) 1 | plg_fields_url (3.7.0) 1 | plg_fields_user (3.7.0) 1 | plg_fields_usergrouplist (3.7.0) 1 | plg_filesystem_local (4.0.0) 1 | plg_finder_categories (3.0.0) 1 | plg_finder_contacts (3.0.0) 1 | plg_finder_content (3.0.0) 1 | plg_finder_newsfeeds (3.0.0) 1 | plg_finder_tags (3.0.0) 1 | plg_installer_folderinstaller (3.6.0) 1 | plg_installer_override (4.0.0) 1 | plg_installer_packageinstaller (3.6.0) 1 | plg_installer_urlinstaller (3.6.0) 1 | plg_installer_webinstaller (4.0.0) 1 | plg_media-action_crop (4.0.0) 1 | plg_media-action_resize (4.0.0) 1 | plg_media-action_rotate (4.0.0) 1 | plg_multifactorauth_email (4.2.0) 0 | plg_multifactorauth_fixed (4.2.0) 0 | plg_multifactorauth_totp (3.2.0) 0 | plg_multifactorauth_webauthn (4.2.0) 0 | plg_multifactorauth_yubikey (3.2.0) 0 | plg_privacy_actionlogs (3.9.0) 1 | plg_privacy_consents (3.9.0) 1 | plg_privacy_content (3.9.0) 1 | plg_privacy_message (3.9.0) 1 | plg_privacy_user (3.9.0) 1 | plg_quickicon_downloadkey (4.0.0) 1 | plg_quickicon_extensionupdate (3.0.0) 1 | plg_quickicon_joomlaupdate (3.0.0) 1 | plg_quickicon_overridecheck (4.0.0) 1 | plg_quickicon_phpversioncheck (3.7.0) 0 | plg_quickicon_privacycheck (3.9.0) 1 | plg_sampledata_multilang (4.0.0) 1 | plg_system_accessibility (4.0.0) 0 | plg_system_actionlogs (3.9.0) 0 | plg_system_cache (3.0.0) 0 | plg_system_debug (3.0.0) 1 | plg_system_fields (3.7.0) 1 | plg_system_guidedtours (4.3.0) 1 | plg_system_highlight (3.0.0) 1 | plg_system_httpheaders (4.0.0) 0 | plg_system_jooa11y (4.2.0) 1 | plg_system_languagecode (3.0.0) 0 | plg_system_languagefilter (3.0.0) 0 | plg_system_log (3.0.0) 1 | plg_system_logout (3.0.0) 1 | plg_system_logrotation (3.9.0) 1 | plg_system_privacyconsent (3.9.0) 0 | plg_system_redirect (3.0.0) 1 | plg_system_remember (3.0.0) 1 | plg_system_schedulerunner (4.1) 1 | plg_system_sef (3.0.0) 1 | plg_system_sessiongc (3.8.6) 1 | plg_system_shortcut (4.2.0) 1 | plg_system_skipto (4.0.0) 1 | plg_system_stats (3.5.0) 1 | plg_system_task_notification (4.1) 1 | plg_system_updatenotification (3.5.0) 0 | plg_system_webauthn (4.0.0) 1 | plg_task_check_files (4.1) 1 | plg_task_demo_tasks (4.1) 1 | plg_task_requests (4.1) 1 | plg_task_site_status (4.1) 1 | plg_user_contactcreator (3.0.0) 0 | plg_user_joomla (3.0.0) 1 | plg_user_profile (3.0.0) 0 | plg_user_terms (3.9.0) 0 | plg_user_token (3.9.0) 1 | plg_webservices_banners (4.0.0) 1 | plg_webservices_config (4.0.0) 1 | plg_webservices_content (4.0.0) 1 | plg_webservices_installer (4.0.0) 1 | plg_webservices_languages (4.0.0) 1 | plg_webservices_media (4.1.0) 1 | plg_webservices_menus (4.0.0) 1 | plg_webservices_messages (4.0.0) 1 | plg_webservices_modules (4.0.0) 1 | plg_webservices_newsfeeds (4.0.0) 1 | plg_webservices_plugins (4.0.0) 1 | plg_webservices_privacy (4.0.0) 1 | plg_webservices_redirect (4.0.0) 1 | plg_webservices_tags (4.0.0) 1 | plg_webservices_templates (4.0.0) 1 | plg_webservices_users (4.0.0) 1 | plg_workflow_featuring (4.0.0) 1 | plg_workflow_notification (4.0.0) 1 | plg_workflow_publishing (4.0.0) 1 |
3rd Party:: Content - Hot Maps (1.1) 1 | Content - Responsive Lightbox (4.2.0) 1 | Content - Retina Images (4.2.0) 1 | Content - Sparky Content Plugin (1.2.1) 1 | Content - Widgetkit (3.1.14) 1 | PLG_CONVERTFORMS_ACTIVECAMPAIGN (1.0) 1 | PLG_CONVERTFORMS_ACYMAILING (1.0) 1 | PLG_CONVERTFORMS_AWEBER (1.0) 1 | PLG_CONVERTFORMS_CAMPAIGNMONITOR (1.0) 1 | PLG_CONVERTFORMS_CONVERTKIT (1.0) 1 | PLG_CONVERTFORMS_DRIP (1.0) 1 | PLG_CONVERTFORMS_ELASTICEMAIL (1.0) 1 | PLG_CONVERTFORMS_EMAILS (1.0) 1 | PLG_CONVERTFORMS_ERRORLOGGER (1.0) 1 | PLG_CONVERTFORMS_GETRESPONSE (1.0) 1 | PLG_CONVERTFORMS_HUBSPOT (1.0) 1 | PLG_CONVERTFORMS_ICONTACT (1.0) 1 | PLG_CONVERTFORMS_MAILCHIMP (1.0) 1 | PLG_CONVERTFORMS_SALESFORCE (1.0) 1 | PLG_CONVERTFORMS_SENDINBLUE (1.0) 1 | PLG_CONVERTFORMS_ZOHO (1.0) 1 | PLG_CONVERTFORMS_ZOHOCRM (1.0) 1 | PLG_CONVERTFORMSTOOLS_CALCULATIONS (1.0) 1 | PLG_CONVERTFORMSTOOLS_CONDITIONALLO (1.0) ? | PLG_CONVERTFORMSTOOLS_EXPORTSUBMISS (1.0) ? | PLG_CONVERTFORMSTOOLS_GATRACKER (1.0) 0 | PLG_CONVERTFORMSTOOLS_PDF (1.0) 1 | PLG_EDITORS-XTD_CONVERTFORMS (1.0) 1 | Editors-XTD - Widgetkit (3.1.14) 1 | plg_editors_codemirror (5.65.12) 1 | Editor - Sparky Page Builder (1.2.1) 1 | plg_editors_tinymce (5.10.7) 1 | Installer - YOOtheme (1.0.6) 1 | PLG_SYSTEM_CFUPLOADEDFILESCLEANER (1.0) 0 | PLG_SYSTEM_CONVERTFORMS (1.0) 1 | plg_system_nrframework (4.10.7) 1 | plg_system_removegenerator (1.4.1) 1 | System - Sparky On Save (4.2.0) 1 | plg_system_tgeoip (2.2.1) 1 | System - Widgetkit (3.1.14) 1 | System - Widgetkit K2 (3.1.14) 0 | System - Widgetkit ZOO (3.1.14) 0 |
Templates Discovered :: wrote:Templates :: Site :: cassiopeia (1.0) 1 | coworking (1.0.0) 1 | sparky_framework (4.2.0) 1 |
Templates :: Admin :: atum (1.0) 1 |
Last edited by toivo on Mon Apr 01, 2024 11:16 pm, edited 1 time in total.
Reason: mod note: disabled smilies in post Options for readability

gws
Joomla! Champion
Joomla! Champion
Posts: 5952
Joined: Tue Aug 23, 2005 1:56 pm
Location: South coast, UK
Contact:

Re: Errors when site moved to new server

Post by gws » Thu Mar 28, 2024 9:29 am

Potential Missing Extensions :: fileinfo | This needs to be enabled in your php settings on the server.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30945
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Errors when site moved to new server

Post by Per Yngve Berg » Thu Mar 28, 2024 9:33 am

Max. Upload Size: 512M | Max. POST Size: 8M | Max. Input Time: 60 | Max. Execution Time: 30 | Memory Limit: 128M

Post size must be larger than upload.

Recommend 64M 128M and Memory 256M.

ukfish1
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Thu Jan 12, 2012 3:59 pm

Re: Errors when site moved to new server

Post by ukfish1 » Mon Apr 01, 2024 2:06 pm

Hi

thanks for the advice.

I increased the post size and that has solved the problem of the javascript error relating to email address.

I have also installed fileinfo extension of PHP 8.1 but I am still having problems with the administration area not dipalyiong correctly.

https://www.midsurreybowls.co.uk/administrator/

is there anything else you might be able to suggest?

paul

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9747
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Errors when site moved to new server

Post by AMurray » Mon Apr 01, 2024 10:18 pm

A shot on the dark, try turning Gzip off if you think it's not working correctly?

FPA shows: GZip: true so set to "false" (in the configuration.php file).

I don't know if it will make a difference.

Are you using the default htaccess file?
Regards - A Murray
General Support Moderator

ukfish1
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Thu Jan 12, 2012 3:59 pm

Re: Errors when site moved to new server

Post by ukfish1 » Tue Apr 02, 2024 6:50 am

Hi

Thanks

I have set gzip to false in the config file but the admin area still not displaying correctly.

This is the htaccess file:
##
# @package Joomla
# @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of Apache mod_rewrite, but it may have already been set by
# your server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## MISSING CSS OR JAVASCRIPT ERRORS
#
# If your site looks strange after enabling this file, then your server is probably already
# gzipping css and js files and you should comment out the GZIP section of this file.
##

## OPENLITESPEED
#
# If you are using an OpenLiteSpeed web server then any changes made to this file will
# not take effect until you have restarted the web server.
##

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## No directory listings
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>

## Suppress mime type detection in browsers for unknown types
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
</IfModule>

## Protect against certain cross-origin requests. More information can be found here:
## https://developer.mozilla.org/en-US/doc ... icy_(CORP)
## https://web.dev/why-coop-coep/
#<IfModule mod_headers.c>
# Header always set Cross-Origin-Resource-Policy "same-origin"
# Header always set Cross-Origin-Embedder-Policy "require-corp"
#</IfModule>

## Disable inline JavaScript when directly opening SVG files or embedding them with the object-tag
<FilesMatch "\.svg$">
<IfModule mod_headers.c>
Header always set Content-Security-Policy "script-src 'none'"
</IfModule>
</FilesMatch>

## These directives are only enabled if the Apache mod_rewrite module is enabled
<IfModule mod_rewrite.c>
RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment the following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
# PHP FastCGI fix for HTTP Authorization, required for the API application
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# -- SEF URLs for the API application
# If the requested path starts with /api, the file is not /api/index.php
# and the request has not already been internally rewritten to the
# api/index.php script
RewriteCond %{REQUEST_URI} ^/api/
RewriteCond %{REQUEST_URI} !^/api/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the /api/index.php script
RewriteRule .* api/index.php [L]
# -- SEF URLs for the public frontend application
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.
</IfModule>

## These directives are only enabled if the Apache mod_rewrite module is disabled
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When Apache mod_rewrite is not available, we instruct a temporary redirect
# of the start page to the front controller explicitly so that the website
# and the generated links can still be used.
RedirectMatch 302 ^/$ /index.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>

## GZIP
## These directives are only enabled if the Apache mod_headers module is enabled.
## This section will check if a .gz file exists and if so will stream it
## directly or fallback to gzip any asset on the fly
## If your site starts to look strange after enabling this file, and you see
## ERR_CONTENT_DECODING_FAILED in your browser console network tab,
## then your server is already gzipping css and js files and you don't need this
## block enabled in your .htaccess
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist
# and the client accepts gzip.
RewriteCond "%{HTTP:Accept-encoding}" "gzip"
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

# Serve gzip compressed JS files if they exist
# and the client accepts gzip.
RewriteCond "%{HTTP:Accept-encoding}" "gzip"
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]

# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header set Content-Encoding gzip

# Force proxies to cache gzipped &
# non-gzipped css/js files separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>

ukfish1
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Thu Jan 12, 2012 3:59 pm

Re: Errors when site moved to new server

Post by ukfish1 » Wed Apr 03, 2024 12:31 pm

Still struggling with this issue.

Can anyone tell if there is anything in the htaccess file that could be causing the problem.

This only became a problem when the site was moved to a new serve r. It worked fine on the old server.

Thanks paul


Post Reply

Return to “Administration Joomla! 4.x”