我想隐藏“www.blahblah.com/index.php”中的“index.php”?怎么做?从“www.blahblah.com/index.php”隐藏“index.php”
Please help,我现在有很多的代码,我打算从网站掩藏index.php
。我搜索了一下,发现你首先需要创建.htaccess
文件。但我不知道从哪里开始呢?我是否需要与我的项目一起创建该文件?以及在该文件中键入什么内容?
我想隐藏“www.blahblah.com/index.php”中的“index.php”?怎么做?从“www.blahblah.com/index.php”隐藏“index.php”
Please help,我现在有很多的代码,我打算从网站掩藏index.php
。我搜索了一下,发现你首先需要创建.htaccess
文件。但我不知道从哪里开始呢?我是否需要与我的项目一起创建该文件?以及在该文件中键入什么内容?
创建.htaccess文件,然后将代码复制下面 更改项目 的文件夹中的“project_folder_name”如果你的项目是在刚刚把“/”
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /project_folder_name
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
'index.php'你的根文件夹不必隐藏在网址栏中!你可以直接指向'目录名称',并自动选择'index.php'文件!它不会显示在网址栏中!像:'localhost/Sandbox'(如果你有一个名为index.php的文件,这个叫做) – Rizier123 2014-11-23 05:36:53
好吧,那怎么做? – 2014-11-23 05:37:59
如果你建立链接,像这样:'home'而不是'home' – Rizier123 2014-11-23 05:39:02