Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jaffamonkey

    (@jaffamonkey)

    Most solutions posted only redirect to the the domain, not with full path.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You’d want to do this: https://halfelf.org/2012/htaccess-anarchy/

    RewriteCond %{HTTP_HOST} ^blog\.example\.com  [NC]
    RewriteRule ^(.*) https://example.com/$1 [L,R=301]
    Thread Starter jaffamonkey

    (@jaffamonkey)

    That looks good, but it doesnt appear to be applying. I guess there is clash in htaccess(?). Could someone let me know where the above lines should fit in, I would be grateful. I am “googled out” on this problem ??

    This is my current file.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # BEGIN WordPress
    <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
    
    <IfModule mod_security.c>
     SecFilterEngine Off
     SecFilterScanPOST Off
    </IfModule>
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Well there’s problem one. You didn’t follow the directions of ‘replace’ the .htaccess….

    RewriteCond %{HTTP_HOST} ^blog\.example\.com  [NC]
    RewriteRule ^(.*) https://example.com/$1 [L,R=301]
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress
    
    <IfModule mod_security.c>
     SecFilterEngine Off
     SecFilterScanPOST Off
    </IfModule>
    Thread Starter jaffamonkey

    (@jaffamonkey)

    That was current htaccess without any edit – I just wasn’t sure where to put those lines. Thankyou so much, very appreciated ?? It works! And I learned a little more about rewrites, so no bad thing

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect subdomain URL path to main domain (and keeping exact URL path)’ is closed to new replies.