I have the htaccess from wordpress codex for a subdomain.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

but the wordpress installation is in a subfolder of the subdomain. I am confused how to create the correct htaccess file.

  • 1
    how is SSL relevant here? What is the exact problem? why do you modify the htaccess generated by wordpress? – Mark Kaplun Sep 20 '16 at 16:37
  • As @MarkKaplun stated. Also, What is your website pointing to now and what do you expected it to be? – Ethan Jinks O'Sullivan Sep 20 '16 at 17:46
  • I just ended up using just subdomain with the htaccess info above. Having a subdomain and subfolder with wordpress causes problems with .htaccess – Jessica Kafor Sep 21 '16 at 19:29

Typically if your subdomain's root is the folder with WP installed, then just create a .htaccess file there. That always works for me. Example:

public_html -> 
   mywpfolder (the wp folder)
      .htaccess (create htaccess file here or simply copy/paste the primary one here)


Do you have the other installs in your domain root or the subfolder root? In any case adding the htaccess file to the folder that has your wp-admin, wp-content, etc should work for that WordPress install - it shouldn't affect other installs. Unless I misunderstood your question.

  • There is other installations in the root. – Jessica Kafor Sep 20 '16 at 16:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.