0
我有一個codeigniter php應用程序,它在我的本地機器(IIS)上完美工作,但是當我將它部署到LAMP服務器(Apache)時,我只能訪問http://<ip-ddress>:8080/company/
但不是該網站上的任何其他鏈接,例如。 http://<ip-ddress>:8080/company/help
,http://<ip-ddress>:8080/company/aboutus
等Apache服務器上的Php Codeigniter - 內部頁面不起作用
這是我虛擬主機條目阿帕奇在遠程服務器上:
<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot "/app/content/pages"
DirectoryIndex index.php
ServerName company.xxx.xxxx.xxx
ServerAlias company.xxx.xxxx.xxx
LogLevel debug
ErrorLog "|/app/server/apache2/bin/rotatelogs logs/company.xxx.xxxx.xxx-error_log 50M"
<Directory "/app/content/pages">
Options Includes FollowSymLinks
AllowOverride All Options FileInfo
Order allow,deny
Allow from all
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IFModule>
</Directory>
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
ServerSignature Off
</VirtualHost>
這是我笨配置設置 - 的application/config/config.php文件
$config['base_url'] = 'http://<ip-address>:8080/company/';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['proxy_ips'] = '';
這是我的application/config/routes.php:
$route['(:num)'] = "home/index/$1";
$route['help'] = "home/help";
$route['home/(:num)'] = "home/index/$1";
$route['default_controller'] = "home";
$route['404_override'] = '';
它看起來並不像你重新寫了'index.php'文件。 'http://:8080/company/index.php/help'是否有效? –
stormdrain
@stormdrain,實際上工作! – sunskin
謝謝!什麼是最好的地方有?是否應該添加到httpd-vhosts.conf虛擬主機條目中? –
sunskin