TP-Admin V5 入口文件是 /Public/index.php,请将DocumentRoot指向到 /Public/ ;
# Apache 服务器
## 重写配置
系统通过设置 public/.htaccess
文件去除链接中的index.php
。 如果你你的服务器使用的是 Apache,请确保开启 mod_rewrite
模块。
如果系统附带的 .htaccess
文件在你的Apache环境中不起作用,请尝试下面这个版本:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
## VHost设置
<VirtualHost *:80>
ServerName www.tp5.hhailuo.com
ServerAlias *.tp5.hhailuo.com
DocumentRoot d:/wamp64/www/tp5/Public
<Directory "d:/wamp64/www/tp5/Public/">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
# Nginx 服务器
## 重写配置
如果是 Nginx 服务器,将下列指令放到网址的配置文件中,就能让网址更优雅了:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
## VHost 配置
server { listen 80; server_name tp5.hhailuo.com *.tp5.hhailuo.com; index index.html index.php; root /var/www/tp3/Public/; if ($host = 'tp5.hhailuo.com' ) { rewrite ^/(.*)$ http://www.tp5.hhailuo.com/$1 permanent; } location / { try_files $uri $uri/ /index.php?$query_string; } location /index.php { include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; } location ~ .*\.(xml|gif|jpg|jpeg|png|bmp|swf|woff|woff2|ttf|js|css)$ { expires 30d; } error_log /var/log/nginx/hhailuo/error.log; access_log /var/log/nginx/hhailuo/access.log; }