从Symfony的1.4路径删除“网络”共享托管?路径、网络、Symfony

2023-09-02 10:11:20 作者:执手不离

我发现了很多有用的信息有关在共享的托管计划安装Symfony的1.4,但我已经运行到这一切的一天困惑我的绊脚石。

I've found a lot of helpful information about installing Symfony 1.4 on a shared hosting plan, but I've run into a stumbling block that's confounded me all day.

要 http://www.alternium.net/jobeet/index.php返回,​​而不是该文件的404 http://www.alternium.net/jobeet/网络/ index.php文件。

Going to http://www.alternium.net/jobeet/index.php returns a 404 instead of the file at http://www.alternium.net/jobeet/web/index.php.

/jobeet/.htaccess:

/jobeet/.htaccess:

Options +FollowSymLinks +ExecCGI

# Enable rewrite engine and route requests to framework
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/robots.txt
RewriteRule ^(.*)$ /jobeet/web/robots.txt [L]

# resources
RewriteCond %{REQUEST_URI} ^/images/  [OR]
RewriteCond %{REQUEST_URI} ^/js/      [OR]
RewriteCond %{REQUEST_URI} ^/fonts/   [OR]
RewriteCond %{REQUEST_URI} ^/css/     
RewriteRule ^(.*)$ /jobeet/web/$1 [L]

RewriteCond %{REQUEST_URI} !^/jobeet/web/
RewriteCond %{REQUEST_URI} !^/frontend_dev.php
RewriteRule ^(.*)$ /jobeet/web/index.php/$1 [QSA,L]

RewriteCond %{REQUEST_URI} frontend_dev.php
RewriteRule ^$ /jobeet/web/$1 [QSA,L]

/jobeet/web/.htaccess:

/jobeet/web/.htaccess:

Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} ..+$
  #RewriteCond %{REQUEST_URI} !.html$
  #RewriteRule .* - [L]

  RewriteCond %{REQUEST_URI} ..+$
  RewriteCond %{REQUEST_URI} !.html$
  RewriteCond %{REQUEST_URI} !.php
  #RewriteCond %{REQUEST_URI} !.php
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]

</IfModule>

任何人都可以用比Symfony的我更好地理解或重写规则告诉我,我要去哪里错了?

Can anyone with a better understanding than I of Symfony or rewrite rules tell me where I'm going wrong?

推荐答案

如果您有私人文件夹的共享主机上(如上的Plesk主机),你可以把你所有的symfony文件夹(预计网/)在您的私人文件夹。然后,你必须调整你的web目录中的symfony的configs和路径,您的ProjectConfiguration在前端控制器(index.php文件或frontend_dev.php,...)。

If you have a private folder on your shared host (like on plesk hosts) you can put all your symfony folders (expect web/) in your private folder. Then you have to adjust your web dir in the symfony configs and the path to your ProjectConfiguration in your front controller (index.php or frontend_dev.php, ...).