Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 删除协调器中的索引文件_Php_Apache - Fatal编程技术网

Php 删除协调器中的索引文件

Php 删除协调器中的索引文件,php,apache,Php,Apache,我正在尝试从Coordinator中的url中删除index.php,因为我想在httpd.conf文件中更改该文件在linux中的文件路径 我已经在.htaccess文件中完成了这些更改,但仍然无法删除index.php httpd.conf的位置因发行版而异。通常的地点是: /etc/httpd或 /etc/apache2 但是,您应该能够通过.htaccess文件执行您想要的操作。我发现,虽然它是专门针对Joomla的,但没有理由不适用于非Joomla站点。基本上,您的.htaccess需

我正在尝试从Coordinator中的url中删除index.php,因为我想在httpd.conf文件中更改该文件在linux中的文件路径

我已经在.htaccess文件中完成了这些更改,但仍然无法删除index.php


httpd.conf的位置因发行版而异。通常的地点是:

/etc/httpd或 /etc/apache2

但是,您应该能够通过.htaccess文件执行您想要的操作。我发现,虽然它是专门针对Joomla的,但没有理由不适用于非Joomla站点。基本上,您的.htaccess需要类似于:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule ^index.php/(.*) /$1 [R,L]

这样我的问题就解决了

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]

这取决于您正在使用的linux发行版,但也没有理由不能从.htaccess文件中执行此操作。@gabe3886我无法删除index.php您知道httpd.conf的文件路径是什么吗还请确保$config['index_page']=;一切就绪。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]