htaccess的从XAMPP转向灯开的Ubuntu 13.10后不工作(启用htaccess的Apache中的Linux服务器)(htaccess is not working after moving from XAMPP to LAMP on ubuntu 13.10 (Enable htaccess in apache linux server))

   IT问题网   2018-03-07 00:00:00

问 题

我的codeigniter项目成功在我的xampp系统的url运行,

 的http://本地主机/推送/用户/ allcategories /
 

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

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

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

我的htaccess文件,

rewriteengine叙述上
的rewritecond%{} request_filename!-f
的rewritecond%{} request_filename!-d
重写规则^(。*)$的index.php / $ 1 [l]
 

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

解决方案

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

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

首先,找到

 目录/ var / www /
选择指标的followsymlinks
设置allowoverride无
要求所有批准
 /目录
 

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

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

使能模式改写
$ sudo的a2enmod重写
 

然后重新启动服务器,

$ sudo的/etc/init.d/apache2重启
 

运行项目。正常工作。

标签:转向工作启用中的服务器



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

查询字符串和放大器;国防部重写(Query Strings & Mod ReWrite)

problem i'm not too inexperienced with rewrite (not a mas ...

在.xml文件PHP的错误?(PHP error in .xml file)

problem ok firstly, i added this line to my .htaccess fil ...

使用Apache的mod_rewrite解析搜索引擎友好的URL(using apache's mod_rewrite to parse SEO friendly URL's)

problem how do i convert something like me.com/profile/2 ...

搜索引擎友好的URL(Search-Engine Friendly URLs)

problem i am working on building my first search-engine f ...

斜杠之后将文字与.htaccess的变量(Turn text after slashes into variables with HTACCESS)

problem i need to pass 3 variables with a url but using s ...

从URL删除字符与htaccess的(Remove Characters from URL with htaccess)

problem hopefully someone can see what i'm do ...

重定向所有的HTML扩展到.PHP(redirect all .html extensions to .php)

problem i want to update all the pages on a website to us ...

需要转义#(哈希/磅)字符在.htaccess重写规则(need to escape # (hash/pound) character in .htaccess rewrite rule)

problem the question is fairly simple but i w ...

如何使用的.htaccess重写规则改变下划线以破折号(How do I use .htaccess RewriteRule to change underscores to dashes)

problem i'm working on a site, and its cms used to save n ...

请求实体太大PHP(Request Entity Too Large PHP)

problem in one of my cakephp site, i got this error. req ...

的.htaccess使用PHP $ _GET缩短网址(.htaccess shorten URL using php $_GET)

problem i need to be able to shorten my page from: mydom ...

Gzip已融为一体pression通过的.htaccess不工作(Gzip compression through .htaccess not working)

problem i have been creating a site and checking it's spe ...

重定向www.subdomain.example.com到subdomain.example.com(redirecting www.subdomain.example.com to subdomain.example.com)

problem i've had some users trying to access a site that ...

添加尾随斜线的.htaccess(Add Trailing Slash .htaccess)

problem i'm trying to get the following effec ...

禁用所有的CGI(PHP,PERL,...)使用的.htaccess目录(Disable all CGI (php, perl, …) for a directory using .htaccess)

problem i have a directory where users can upload files. ...

在某个目录设置为仅附件上的文件内容处理标头?(Set Content-Disposition header to attachment only on files in a certain directory)

problem i've got this this rule in my htaccess file to fo ...

阿帕奇升级到2.4后,内部URL重写不再工作(Internal URL rewrite no longer working after upgrading Apache to 2.4)

problem i need to internally rewrite the base url so that ...

使用codeigniter共享托管服务器上的困惑(Puzzled using codeigniter on shared hosting server)

problem this ones a new on me. i'm transferring a site i ...

通过用户代理或空的查询块(Block by useragent or empty referer)

problem a stranger bot (gbplugin) is codifying the urls o ...

的.htaccess中:RewriteEngine此处不允许(.htaccess: RewriteEngine not allowed here)

problem i uploaded the .htaccess to the server and receiv ...