How can I make sure that within the subdomain directory, when clicking a link, the url is not modified and the file extension does not appear?

0

I do not know if I could be clear, but I have the following code in .htaccess in the root folder:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]

The purpose of it is to remove the file extension, eg if the file is comercial.php, in the link to call it I can put commercial /. So far it works perfectly, but I noticed that for images, links, css, etc. work, I have to put the absolute path, which in PHP I'm calling it this way:

$caminhoAbsoluto = $http . $_SERVER['SERVER_NAME'] . "/sistema";

The only problem is that I am working with subdomains, every tenant will have his subdomain and not to change the url, I placed a .htaccess within each subdomain as below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^inquilino1.site.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.inquilino1.site.com.br$
RewriteRule ^(.*)$ http://www.site.com.br/sistema/$1 [P]

Access to each is then done through the subdirectory below:

  

link

which is addressed this way:

  

link

The problem is that when I click on one of the menu items, it appears as below:

  

link

When you would really like to stay:

  

link

And when I remove the absolute path, it looks like this:

  

link

When should it be:

  

link

and when I leave the absolute path, it looks like this:

  

link

And when I click, it expels me from the system.

How can I make sure that within the subdomain directory, when clicking a link, the url is not modified and the file extension does not appear?

I'm sorry if I could not be very clear on my question, but I think you could understand a little.

    
asked by anonymous 13.07.2018 / 18:25

0 answers