从url codeigniter中删除index.php文件';无法在Windows server中工作
如何从windows server中删除index.php 从中找到了答案 尝试了以下方法 1.在codeigniter项目的我的根目录中创建一个名为从url codeigniter中删除index.php文件';无法在Windows server中工作,php,.htaccess,codeigniter,azure,Php,.htaccess,Codeigniter,Azure,如何从windows server中删除index.php 从中找到了答案 尝试了以下方法 1.在codeigniter项目的我的根目录中创建一个名为web.config的文件 2.将以下内容放入其中 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule
web.config
的文件
2.将以下内容放入其中
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
但它对我不起作用。您可以尝试以下步骤: 打开文件夹“application/config”并打开文件“config.php”。在config.php文件中查找并替换以下代码
//find the below code
$config['index_page'] = "index.php"
//replace with the below code
$config['index_page'] = ""
然后,如果代码$config['uri\u protocol']=“AUTO”
更改为$config['uri\u protocol']=“REQUEST\u uri”
您可以查看
web.config
的内容,当您修改文件时,需要重新启动Azure web Apps服务器。您可以尝试以下步骤:
打开文件夹“application/config”并打开文件“config.php”。在config.php文件中查找并替换以下代码
//find the below code
$config['index_page'] = "index.php"
//replace with the below code
$config['index_page'] = ""
然后,如果代码$config['uri\u protocol']=“AUTO”
更改为$config['uri\u protocol']=“REQUEST\u uri”
你的
web.config
的内容应该可以,当你修改文件时,你需要重新启动Azure web Apps服务器。从url中删除index.php是htaccess必须完成的事情,
转到应用程序的根目录,创建名为“.htaccess”的新文件,并输入以下内容:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
从url中删除index.php是htaccess必须完成的事情, 转到应用程序的根目录,创建名为“.htaccess”的新文件,并输入以下内容:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]