Ver Mensaje Individual
  #10 (permalink)  
Antiguo 09/12/2015, 09:00
molinasergio91
 
Fecha de Ingreso: enero-2013
Ubicación: Santa Fe, VT
Mensajes: 68
Antigüedad: 11 años, 3 meses
Puntos: 2
Respuesta: Problema con los recursos en el hosting

recien probe en mi servidor casero, si esta activado el mod_rewrite y estas en prod, con que el host apunte a el directorio /web deberia funcionar. Es decir:

El host www.proyecto.com >>> apunta a /web
si el mod_rewrite esta activado, es lo mismo poner "www.proyecto.com/app.php" que "www.proyecto.com"
Por lo menos con mi configuracion del .htaccess, que es la que viene por default, funciona.

La dejo por si te sirve:
Código Apache:
Ver original
  1. # Use the front controller as index file. It serves as a fallback solution when
  2. # every other rewrite/redirect fails (e.g. in an aliased environment without
  3. # mod_rewrite). Additionally, this reduces the matching process for the
  4. # start page (path "/") because otherwise Apache will apply the rewriting rules
  5. # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
  6. DirectoryIndex app.php
  7.  
  8. # By default, Apache does not evaluate symbolic links if you did not enable this
  9. # feature in your server configuration. Uncomment the following line if you
  10. # install assets as symlinks or if you experience problems related to symlinks
  11. # when compiling LESS/Sass/CoffeScript assets.
  12. # Options FollowSymlinks
  13.  
  14. # Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
  15. # to the front controller "/app.php" but be rewritten to "/app.php/app".
  16. <IfModule mod_negotiation.c>
  17.     Options -MultiViews
  18. </IfModule>
  19.  
  20. <IfModule mod_rewrite.c>
  21.     RewriteEngine On
  22.     # Determine the RewriteBase automatically and set it as environment variable.
  23.     # If you are using Apache aliases to do mass virtual hosting or installed the
  24.     # project in a subdirectory, the base path will be prepended to allow proper
  25.     # resolution of the app.php file and to redirect to the correct URI. It will
  26.     # work in environments without path prefix as well, providing a safe, one-size
  27.     # fits all solution. But as you do not need it in this case, you can comment
  28.     # the following 2 lines to eliminate the overhead.
  29.     RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
  30.     RewriteRule ^(.*) - [E=BASE:%1]
  31.  
  32.     # Sets the HTTP_AUTHORIZATION header removed by apache
  33.     RewriteCond %{HTTP:Authorization} .
  34.     RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  35.  
  36.     # Redirect to URI without front controller to prevent duplicate content
  37.     # (with and without `/app.php`). Only do this redirect on the initial
  38.     # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
  39.     # endless redirect loop (request -> rewrite to front controller ->
  40.     # redirect -> request -> ...).
  41.     # So in case you get a "too many redirects" error or you always get redirected
  42.     # to the start page because your Apache does not expose the REDIRECT_STATUS
  43.     # environment variable, you have 2 choices:
  44.     # - disable this feature by commenting the following 2 lines or
  45.     # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
  46.     #   following RewriteCond (best solution)
  47.     RewriteCond %{ENV:REDIRECT_STATUS} ^$
  48.     RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
  49.  
  50.     # If the requested filename exists, simply serve it.
  51.     # We only want to let Apache serve files and not directories.
  52.     RewriteCond %{REQUEST_FILENAME} -f
  53.     RewriteRule .? - [L]
  54.  
  55.     # Rewrite all other queries to the front controller.
  56.     RewriteRule .? %{ENV:BASE}/app.php [L]
  57. </IfModule>
  58.  
  59. <IfModule !mod_rewrite.c>
  60.     <IfModule mod_alias.c>
  61.         # When mod_rewrite is not available, we instruct a temporary redirect of
  62.         # the start page to the front controller explicitly so that the website
  63.         # and the generated links can still be used.
  64.         RedirectMatch 302 ^/$ /app.php/
  65.         # RedirectTemp cannot be used instead
  66.     </IfModule>
  67. </IfModule>