3
I just uploaded a site to Locaweb on a simple and shared Linux hosting, only it didn’t work for once.
I imagine it is because the index is not in the site root, but inside the folder public
.
Question: How do I make the index within the public
work, since I can’t change the virtualhost configuration?
Thank you Ps. htaccess is so:
RewriteEngine on
#AddHandler php53-script .php .php5 .php53 .pht .phtm .phtml
#suPHP_ConfigPath /home/site1389376316/
AddHandler php55-script .php
DirectoryIndex public/index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [QSA]
I was able to solve the problem in parts. I made a small change in htaccess.
I removed this line:
DirectoryIndex public/index.php
And I changed this:
RewriteRule ^(.*)$ public/index.php?p=$1 [QSA]
This way the site loads but as a consequence the image files, css, js that are all in the public folder are not found.
What can I do?
I spoke here of a similar problem in the Laravel. And apparently, the
Silex
also uses theSymphony
. See: http://answall.com/questions/43685/problema-com-subpastas-e-reescrita-de-url-laravel– Wallace Maxters
Have you tried
RewriteRule ^(.*)$ public/index.php?p=$1
?– Wallace Maxters
@Wallacemaxters I did try. Only then when I write Silex.dominio.com/admin for example it gives an internal error and the url changes to Silex.dominio.com/admin/? p=admin. Do you have any idea what this might be?
– Joao Nivaldo
Try to level up your directory structure and change the public to the public_html folder.
– gmsantos