I have Wordpress and I am reasonably familiar with it as a basic user. I have recently upgraded my hosting package to include SSL. I mention that because it did cause some teething problems with Wordpress.
Wordpress is installed in a folder, so my main website is https://www.www.mywebsite.com
and my Worpress is accessed at https://www.mywebsite.com/wpfolder/
this all works fine
I have 404 redirects on my main site to a custom page, and Wordpress takes care of any Wordpress 404 redirects to its own custom page.
After a previous discussion on Sitepoint I also added some 301 redirects so my canonical url is https://www.mywebsite.com
and all domains now point there (I only have one physical domain and no duplicate pages - this is simply to stop Google seeing fake duplicate content)
Now my problem - the following .htaccess seems to work perfectly with everything :-
# 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
#RewriteBase /
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#</IfModule>
# END WordPress
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mywebsite.com [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301]
If I remove the comment tags for the wordpress lines then my 404 redirect stops working for my main site
But am I messing up Wordpress by commenting out the Wordpress entries, is Wordpress as their comments state going to overwrite my .htaccess or does it have its own virtual one. I need to have the 301 redirects, I need the custom 404 redirects for both my site and the Wordpress site and I need to be sure Wordpress will work OK - is what I am doing OK, is there a better way, am I building problems for myself - thanks