Pregunta

I am new and I need some help on .htaccess. I've search for hours already and I can't find a solution.

So basically, we own several domains but we only have one hosting service. On the root directory we have a wordpress site installed and working just fine let us say it has domain1.com.

We added a sub directory, put a system (custom made php system) and added a domain on it (let's say domain2.com). this is working just fine if we access domain2.com/page.php

But the way we set up the system is that we only want to show domain2.com/page on the url and we are just include_once the page.php.

What is happening right now, if we are going to domain2.com/page it goes to the wordpress site telling us that page doesn't exist. Which is true.

I've read about .htaccess but I can't seem to figure out what to put in there. we tried several suggestion from the internet but it is not working. currently this is the .htaccess on the root folder

# 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

We tried to remove the lines

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

but it is still redirecting us to the wordpress page.

I hope I'm explaining myself well. And I hope someone can help me with this. Thanks!

No hay solución correcta

Otros consejos

basically in your root folder (the publish_html) you should not put any of your websites. lets say you have 2 website, web1 and web2. create a folder public_html/web1.com (the .com is just a common convention) and public_html/web2.com.

put each website files in each folder, remmeber that each website has it's own files,framework,.htaccess etc.

the routing for domain web1.com to the folder web1.com and web2.com to the folder web2.com should be in the server itself, in the vhost, NOT in the htaccess. if you are using cPanel you can just go to add domain and when you add a domain you can set the folder for the domain. so define a new domain web1.com and add it to public_html/web1.com. same for web2.com

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top