Run SILEX site in shared hosting

1

Personal I developed a site using the Silex Micro Framework for a client and I need to host it on locaweb with a shared hosting. Silex as well as Laravel and other frameworks index.php is not in the root of the site but in the Public folder. In this hosting I can not change the root folder of the site. How would I do to redirect to the index in the public folder? Thanks

    
asked by anonymous 24.03.2015 / 19:36

1 answer

0

Hello! Well, if my comment helps anyone.

See, it is possible to have an application with the index in webroot, according to the documentation. In the documentation it is also exemplified as redirecting to another path outside of the webroot, if you so wish. "If your site is not at the webroot level you will have to uncomment the RewriteBase statement and adjust the path to your directory, relative from the webroot." So for those who still have questions, you can find out at: link

I'll leave here a setting that might help: An example for an app with the files in the '\ web' folder and the Silex core in webroot '\':

/public_html/.htaccess:

<IfModule mod_rewrite.c> 
     RewriteEngine On 
     RewriteRule ^$ /web/ [L] 
     RewriteCond %{REQUEST_FILENAME} !-f 
     RewriteCond %{REQUEST_FILENAME} !-d 
     RewriteCond %{REQUEST_URI} !^/web/ 
     RewriteRule ^(.*)$ /web/$1 
     RewriteCond %{SCRIPT_FILENAME} -d 
     RewriteRule ^website.com/(.*[^/])$ http://www.website.com/$1/ [R=301] 
</IfModule>

/public_html/web: 

<IfModule mod_rewrite.c>
     Options -MultiViews 

     RewriteEngine On 
     #RewriteBase / 
     RewriteCond %{REQUEST_FILENAME} !-f 
     RewriteRule ^ index.php [QSA,L] 
</IfModule>
    
20.06.2016 / 01:16