htaccess的从XAMPP转向灯开的Ubuntu 13.10后不工作(启用htaccess的Apache中的Linux服务器)转向灯、服务器、工作、XAMPP

2023-09-02 09:49:25 作者:余归

我的codeIgniter项目成功在我的XAMPP系统的URL运行,

My CodeIgniter project is running successfully on my XAMPP system with the url,

http://localhost/newsfeeds/users/allCategories/

当我提出这个项目到另一个系统上的Ubuntu 13.10 LAMP服务器。要运行在同一个页面,我需要的网址,

When I move this project to another system has LAMP server on Ubuntu 13.10. To run the same page I need the url,

http://localhost/newsfeeds/index.php/users/allCategories/

我需要的index.php文件,否则它显示一个页面不源泉错误。

I need the index.php file otherwise it shows a page not fount error.

我的htaccess文件,

My htaccess file is,

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

我怎么能运行在同一个项目没有的index.php无论WAMPP和XAMP服务器上?

How can I run the same project without index.php on both WAMPP and XAMP server ?

推荐答案

我发现这个问题的解决方案。

I found the solution for this issue.

在我的服务器模式改写已经打开。但是,一些默认值需变化对 /etc/apache2/apache2.conf中文件。以下是我的变化,

In my server the mode rewrite is already on. But some default values need to be change on /etc/apache2/apache2.conf file. Following are my changes,

首先,找到

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

和变化的设置AllowOverride无到所有并保存。

然后使用命令(在这种情况下,已经enabeled),

Then enable mode rewrite using the command(In this case already enabeled),

$ sudo a2enmod rewrite

然后重新启动服务器,

Then restart the server,

$ sudo /etc/init.d/apache2 restart

运行项目。正常工作。

Run the project. Works fine.

 
精彩推荐
图片推荐