ThinkPHP去掉URL中的index.php】的更多相关文章

我的环境是apache+ubuntu 1,先确认你有没mod_rewrite.so模块 /usr/lib/apache2/modules/mod_rewrite.so 然后在httpd.conf最后一行加上(我不加也行,自己都奇怪) LoadModule rewrite_module modules/mod_rewrite.so 重启/etc/init.d/apache2 restart 2,将/etc/apache2/sites-enabled/000-default中的 AllowOverr…
去掉 URL 中的 index.php 通常的URL里面含有index.php,为了达到更好的SEO效果可能需要去掉URL里面的index.php ,通过URL重写的方式可以达到这种效果,通常需要服务器开启URL_REWRITE模块才能支持. 例如原来的 URL 为: http://127.0.0.1/index.php/Index/insert 去掉 index.php 之后变为: http://127.0.0.1/Index/insert 第一步:更改Apache的httpd.conf 配置…
在nginx环境下CI框架默认URL规则访问不了,出现500错误,如: http://blog.php230.com/index.php/keywords 今天在服务器配置CI框架环境时,去除URL中的index.php,出现了默认URL规则访问不了的情况,只能通过参数方式访问: http://blog.php230.com/index.php?c=keywords 配置: location /{ if (-f $request_filename) { expires max; break; }…
例如你的原路径是 http:.httpd.conf配置文件中加载了mod_rewrite.so模块  .AllowOverride None 讲None改为 All      .确保URL_MODEL设置为2,在项目的配置文件里写  .htaccess文件必须放到跟目录下 这个文件里面加: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.…
原路径是 http://localhost/test/index.php/index/add 想获得的地址是 http://localhost/test/index/add 那么如何去掉index.php呢? @_@!!   (1)apache 设置 httpd.conf配置文件中加载了mod_rewrite.so模块 LoadModule rewrite_module modules/mod_rewrite.so AllowOverride None 讲None改为 All <Director…
例如你的原路径是 http://localhost/test/index.php/home/goods/index.html 那么现在的地址是 http://localhost/test/home/goods/index.html 如何去掉index.php呢? 1.httpd.conf配置文件中加载了mod_rewrite.so模块  //在APACHE里面去配置 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉 2.Allow…
例如你的原路径是 http://localhost/test/index.php/home/goods/index.html 那么现在的地址是 http://localhost/test/home/goods/index.html 如何去掉index.php呢?1.httpd.conf配置文件中加载了mod_rewrite.so模块  //在APACHE里面去配置 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉 2.AllowO…
首先,你要清楚自己的 Web 服务器是 Apache,支持 mod_rewrite 查找httpd.conf中是否开启了mod_rewrite.so 然后,在 CI 根目录下新建立一个配置文件,命名为: .htaccess在里面这样写: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ ./index.php/$1 [L] 就可以去掉 index.php 了.要注意 ./ind…
隐藏index.php server { listen 80; server_name yourdomain.com; root /home/yourdomain/www/; index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } location ~ .*\.php(\/.*)*$ { include fastcgi.conf; fastcgi_…
使用情境:我想输入www.abc.com/a/1后,实际上是跳转到www.abc.com/index.php/a/1 配置Nginx.conf在你的虚拟主机下添加: location / {      if (!-e $request_filename){           rewrite ^/(.*)$ /index.php/$1 last;      } } 如果你的项目入口文件在一个子目录内,则: location /目录/ {      if (!-e $request_filenam…