• I have static HTML pages in my domain root (lets say https://mysytez.com)
    I have moved WordPres install into a subdomain (lets say /subz/)
    I also have .htaccess directives to;
    (1) Remove .html from static pages
    (2) Allow WP URLs to remain as if they were in the domain root ( as instructed here https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory)

    The setup works great until I need to access WP backend, at that point I start getting redirect errors.
    The two set of .htaccess directives below both do what they are supposed to on their own, but I suspect when setup together there is obviously some incompatible redirection taking place.
    Unfortunately, I have very little understanding of regex to understand what the directives are doing and how to fix the issue, would someone be able to tell me how to fix this?

    I know the easy option would be to install WP in a folder, but I don’t want the folder name showing up in the URL if I can avoid doing so.
    Thank you in advance

    ## Begin Remove extension from html pages ##
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/$ $1.html
    RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule (.*)$ /$1/ [R=301,L]
    ## End Remove extension from html pages ##

    #BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?mysytez.com$
    RewriteCond %{REQUEST_URI} !^/subz/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /bwms/$1
    RewriteCond %{HTTP_HOST} ^(www.)?mysytez.com$
    RewriteRule ^(/)?$ subz/index.php [L]
    </IfModule>
    #END WordPress

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with .htaccess setup’ is closed to new replies.