在localhost上访问TYPO3前端(BE访问工作正常)

时间:2012-06-21 11:35:15

标签: xampp typo3 frontend vhosts

在我的Mac上成功安装XAMP然后输入typo3后,我设置了一个虚拟主机,以避免在使用TYPO3时输入长URL。

我取消注释处理http-vhosts.conf的http.conf行,以便我可以设置虚拟主机,然后在httpd-vhosts.conf中添加了我的虚拟主机(名为typo3dev),最后我相应地编辑了我的主机文件

到目前为止一直很好,但现在我遇到的问题是,虽然指向BE(http://typo3dev/typo3/)工作得很好(我可以登录并在那里玩得开心),我看不到前端: 将我的浏览器指向http://typo3dev/时,我会被重定向到http://typo3dev/get-started/,在那里我收到一个Page Not Found错误

查看服务器错误日志我得到了

$[Thu Jun 21 12:39:20 2012] [error] [client 127.0.0.1] File does not exist: /Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1/get-started

顺便说一下,我的hosts文件看起来像这样:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       typo3dev

我的httpd-vhosts.conf就是这样:

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/htdocs"
    ServerName localhost
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1"
    ServerName typo3dev
</VirtualHost>

非常感谢您提供任何帮助/意见/建议

干杯

2 个答案:

答案 0 :(得分:2)

对我来说,这看起来像是一个RealURL / Apache配置问题。确保您在Apache配置中allow .htaccess ...

<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1"
    ServerName typo3dev

    <Directory /Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1>
        AllowOverride all
        Order allow,deny
        allow from all
    </Directory>

</VirtualHost>

...或直接在RewriteRules部分配置VirtualHost

<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1"
    ServerName typo3dev

    <Directory /Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1>
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    <Directory /Applications/XAMPP/htdocs/typo3/introductionpackage-4.7.1>
        RewriteEngine On
        RewriteRule ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)$ - [L]
        RewriteRule ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/.*$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteRule .* index.php [L]
    </Directory>

</VirtualHost>

请记住在更改配置后重新加载/重新启动Apache

答案 1 :(得分:0)

在我看来,你已经安装了错误的软件包。仅安装源包,因为所有其他包都是用于演示。如果你可以避免Apache。这很复杂,很臃肿。我可以推荐lighttpd。特别是使用虚拟域进行配置要容易得多。