0
I have domain www.meusite.com.br
I would like to host several systems in this domain. So:
www.meusite.com.br/system1
www.meusite.com.br/system2
www.meusite.com.br/sistema3
I use virtualhost like this:
<VirtualHost *:80>
ServerName meusite.com.br
ServerAlias www.meusite.com.br
ServerAdmin [email protected]
DocumentRoot "/var/www"
Alias /sistema1 "/var/www/sistema1/public"
<Directory "/var/www/sistema1/public">
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Order deny,allow
Allow from all
</Directory>
Alias /sistema2 "/var/www/sistema2/public"
<Directory "/var/www/sistema2/public">
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Order deny,allow
Allow from all
</Directory>
I change the . htaccess of each of the projects for this:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
Options +FollowSymLinks
RewriteEngine On
**RewriteBase /sistema1**
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
The system is all in Laravel. It is working this way above, however, I think it is not the right approach. In another project we’re using, it’s showing errors in the url’s of ajax calls. I am a student and I need to configure this university server to host other systems in this domain.
Could you advise me on which approach to use or what I should start studying? I don’t have much knowledge, I need a direction.
Thank you for your attention. I will do as you said, but the problem is the coordinator wants the addresses to be as I said: www.meusite.com.br/system1 etc. It is possible to do otherwise than I did ?
– Over
I would present to your coordinator the advantages in security issues of isolating one application from another, but thinking about the solution you are proposing I believe that the Rewritebase configuration does not have to have asterisks. Tell me more about the behavior that happens when you run this configuration that I try to help you..
– Samuel Fontebasso
Friend, manage to solve my problem with regard to ajax urls. I will propose what you told me. Hug
– Over