| shared host root ready .htaccess [message #57664] |
Sat, 02 August 2008 13:16  |
scott7 Messages: 86 Registered: December 2007 Location: Dresden, Germany |
Member |
|
|
I guess many have tried to install symfony on a shared host. For mine i had to change the core files a little to get it running. The much bigger problem is the rewrite directives. I hardly can contain my rage on how lunatic this mod_rewrite is! I've been doctoring on my rules for 3 days now! Since most of the rules rewrite the whole meaning of the URL anyway, i demand a usable .htaccess file for the root directory to point up to /web.
Conditions
/root
.htaccess
/config
databases.yml
/web
index.php
/images
test.jpg
Capabilitys
http://shared.host.com/config/databases.yml <= web/config/databases.yml <= 404!
http://shared.host.com/default/index <= /web/index.php/default/index
http://shared.host.com/default/index <= /web/images/test.jpg
+ Caching and all the other tricks.
I hope most of you share my opinion that this should be a default feature / official plugin for symfony.
greetings, scott7
propel-insert-sql: 277 of 290 SQL statements executed successfully
|
|
|
|
| Re: shared host root ready .htaccess [message #57678 is a reply to message #57664 ] |
Sat, 02 August 2008 21:59   |
scott7 Messages: 86 Registered: December 2007 Location: Dresden, Germany |
Member |
|
|
I'm sorry for my harsh words now. We'll see if i manage to build a solution tomorrow.
propel-insert-sql: 277 of 290 SQL statements executed successfully
|
|
|
| Re: shared host root ready .htaccess [message #58234 is a reply to message #57664 ] |
Fri, 08 August 2008 00:19   |
scott7 Messages: 86 Registered: December 2007 Location: Dresden, Germany |
Member |
|
|
They all no use.
I have a subdomain, root folder ist public. I just need a .htaccess that works in / not /web while the files of /web reside in /web.
Freaking mod_rewrite is so complicated.
Nightmare mode: no Command Line!
[Updated on: Fri, 08 August 2008 00:23] propel-insert-sql: 277 of 290 SQL statements executed successfully
|
|
|
| Re: shared host root ready .htaccess [message #58236 is a reply to message #57664 ] |
Fri, 08 August 2008 01:06   |
scott7 Messages: 86 Registered: December 2007 Location: Dresden, Germany |
Member |
|
|
A little logic, great motivation and bang i've done it.
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# we skip all files in /web
RewriteCond %{REQUEST_URI} ^/web/
RewriteRule .* - [L]
# we rewrite all other files with .something to /web
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule ^(.*)$ /web/$1 [L]
# !!! UNTESTED !!! ##################################
# we check if the .html version is in /web (caching)
RewriteRule ^$ /web/index.html [QSA]
RewriteRule ^([^.]+)$ /web/$1.html [QSA]
#####################################################
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ /web/index.php [QSA,L]
</IfModule>
# big crash from our front web controller
ErrorDocument 500 "<h2>Application error</h2>symfony application failed to start properly"
the files in /config are safe, images, controllers work nicely. I don't fully get the caching part and how to test it. I hope someone can verify and help me publish this for good.
UPDATE:
You'll also need this at the beginning of your /web/index.php:
<?php
/* according to .htaccess */
$_SERVER['SCRIPT_NAME'] = '/index.php';
define('SF_ROOT_DIR',...
[Updated on: Mon, 08 September 2008 16:59] propel-insert-sql: 277 of 290 SQL statements executed successfully
|
|
|
|
|
|
| Re: shared host root ready .htaccess [message #84787 is a reply to message #57664 ] |
Thu, 03 September 2009 15:53   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
ntuanphuc, your question is general enough to be addressed to everyone.
Look in your logs to see what the problem might be - looks like you have a general PHP/database error. Try using your *_dev.php front controller, and the error should appear on your screen.
Remember Palestine
|
|
|
|
|
| Re: shared host root ready .htaccess [message #102500 is a reply to message #57664 ] |
Thu, 15 July 2010 06:59  |
ice_j7 Messages: 116 Registered: February 2008 Location: Arequipa - PerĂº |
Senior Member |
|
|
Thanks!!!!!!!!!! it works!!!
Regards!!!
Search in the code, find wisdom.
|
|
|