【发布时间】:2017-04-04 02:33:39
【问题描述】:
我的本地服务器上有一个 sipmle php 应用程序。我正在使用 xampp。我正在尝试从我的网址中删除 index.php。我在互联网上查看了许多文章、文档和问题,并尝试了所有这些,但都没有奏效。这是我的 .htaccess 文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
我已经在 config.php 上修改了这些行:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
并修改httpd.conf:
ServerName localhost:8080
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
...
DocumentRoot "C:/Projeler"
<Directory "C:/Projeler">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
先谢谢了。
【问题讨论】:
标签: php codeigniter url-rewriting