wordpress subfolder redirection + non-www to www redirection
<p>I have my .htaccess set up so that my wordpress works on the main domain instead of the installation folder. </p>

<pre><code># BEGIN WordPress
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?website.com$ [NC]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?website.com$ [NC]
RewriteRule ^(/)?$ folder/index.php [L]
# END WordPress
</code></pre>

<p>And that works mostly fine, but when you write <code>website.com</code> without the <code>www.</code> it just doesn't show. I looked for a solution and thought I had found it, but that started giving me a "too many redirections" error and didn't show anything.</p>

<pre><code># BEGIN WordPress
#
RewriteCond %{HTTP_HOST} !^website\.com$ [NC]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [OR,NC]
RewriteCond %{HTTP_HOST} ^website\.com$ [NC]
RewriteRule ^ http://www.website.com/$1 [L,R=301]
#
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?website.com$ [NC]
RewriteCond %{REQUEST_URI} !^/folder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/$1
RewriteCond %{HTTP_HOST} ^(www.)?website.com$ [NC]
RewriteRule ^(/)?$ folder/index.php [L]
# END WordPress
</code></pre>

<p>So now I'm back to it just not showing without the <code>www.</code> :c</p>