Drupal 8.5.3 Unable to access pages (except Home) after site migration to new server (shared)

Hi Fellows,

I have searched a plenty and tried a few suggestions but o Luck so far so decided I may post this issue for help.

Site in questionwww.atamdhillon.com

Current Error when accessing any page other than Home Page is as below-

********************************************************************************************

The requested URL /my-projects was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache Server at www.atamdhillon.com Port 80

********************************************************************************************

Details –

I had Drupal 8.3.x working well on one server. Upgraded to 8.5.3 and worked well. I had to migrate the site now to a new server. No work done on local servers but all on remote server hosting accounts.

I backed up my site and database. Freshly installed Drupal 8.5.3 on new server. Replaced Themes, Modules, Profiles, site/default/files, loaded the .sql file which had some issues but succeeded after manually running the sql commands.

I can access the Home page fine but non other. URLs work with ?q=admin or user etc but display home page only.

Site is created as an add-on domain in a subdirectory.

No .htaccess was located in this subdirectory. When I copy one across from the vendor folder, it then breaks the whole site and gives no access message. So I deleted and created a new file named .htacces and added code to turn Rewrite Engine On and RewriteBase /subdirectory. This sorted and allowed all the pages to be viewed until this morning I decided to add the base hosting account url to trusted host settings and I am now unable to access pages again.

settings file does have trusted host settings for the domain but the config file had issues when I copied the Files folder from old site. Luckily I hadn’t deleted files folder created by fresh install and copied the config file across that Drupal was looking for. This may be the issue but please advise on how to resolve that. I am not an expert user but can play confidently with code.

I read at places about clean urls be turned on/off but how do I do that, was a bit unclear and the guy at the host support wasn’t able to help and started throwing things back at me as if I was to help him troubleshoot. So here I am need help from the tribe.

The .htaccess file in sites/default/files folder has below code in it –

# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

both site/default/files/config folder have .htaccess files that has the same below code in it.

# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
  # Override the handler again if we're run later in the evaluation list.
  SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>

Any help will be much apreciated.

There was a solution asking to create and access a phpinfo() file. So that you know, it was successful but did not display ‘Enabled Modules’ section as was being instructed to look for by the solution I was following to streamline the problem.

Update free access is turned on at this stage

$settings[‘update_free_access’] = TRUE;

Thanks guys.

Atam Dhillon

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/22/feed