Site logo

Archived topic

Adjusting Header.php

2 replies · Started by Michael on March 18, 2020

Viewing posts 1–3 of 3

Hi guys,

I need your help again please! I have been having an issue creating a canonical 301 redirect from www to non-www version of my site. My host provider said it is not possible to add permanent changes to the Nginx config file because of how they have things set up and made this suggestion:

"To help you, we've tested the method shown at https://wpgyan.com/how-to-redirect-to-another-page-in-wordpress/ with EasyWP and it worked just fine. Please try configuring it or let us know if we should help you with it. To configure it, please access the /wp-content/themes/generatepress/header.php file via FTP and add the code."

I'm not overly keen to mess with the generatepress theme files, so wanted to check if this sounds like it's a good idea to you? And if adding an element rather for the header code would be better? Or would that not have the same effect? I'm asking you guys because EasyWP have not always come up with helpful solutions and I don't entirely trust what they say, so wanted to run it by you first. Many thanks for your help.

Michael.

Hello Michael,

You don't need to change GP files, and it is really not recommended to do so.
You can always use Hooks to insert code on various sections of your website.

https://docs.generatepress.com/article/hooks-element-overview/

Also check your website URL on you Settings > General and remove the www. from your URL in case you have it, maybe it helps.

Thanks Vitor - as he said Michael :)

This archived topic is closed to new replies.