WordPress htacess for every subdirctory

I’ve got this structure:

  • public_html
    • site1.com
    • site2.com

After I redirect the URL site1.com to /public_html/site1.com/index.php
my URL is site1.com/site1.com. After I move to any other file, like contact.php
it goes to site1.com/site1.com/contact.php.

This is a WordPress site.
My SiteAdress URL is now http://site1.com/site1.com
WordPress URL is now http://site1.com

I need to get rid of this subfolder in the URL so it should look like:
site1.com/contact.php for example. I’ve tried many ways with .htacess but none worked properly.

Weird thing is that i can acess wp-login.php by just going to site1.com/wp-login.php, but when I try to access site1.com/contact.php it goes to index.php from my public_html/ directory.

I tried RewriteRule ^site1.com/?(.*) /$1
to get rid of this – this actually works well on htacess madewithlove
but it does not work on my website.

How should I acomplish that? Is that even possible?

Cheers.

By the way – should I use .htacess file in root directory or in site1.com/ directory?

Read more here: WordPress htacess for every subdirctory

Leave a Reply

Your email address will not be published. Required fields are marked *