我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在php和html中重写/掩码url地址

I have read a lot of posts on how to rewrite the urls but still I couldn't find a way to rewrite the following:

www.mysite.com/index.php
www.mysite.com/login.html

to appear only like:

www.mysite.com

Any idea?

Generally it should be something like:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1 [L,QSA]
</IfModule>

I suggest you look here Remove 'index.php' from URL with .htaccess for a more specific answer and here for a tutorial

近期文章

  • 访问扩展类中的父函数
  • 如何注销会话Symfony Fos:Userbundle
  • 如何从我的PHP API返回错误 - Phalcon
  • 这个简单的命令在PHP中意味着什么?
  • 是否可以打包和分发基于Laravel的项目及其所有依赖项?
  • PHP正在插入两条记录
  • 将数字添加到preg_match
  • require_once():无法打开所需的'...'(但文件存在)
  • 这个PHP函数中没有按预期工作的东西
  • 如果数组echo键中存在post数据
  • PHP MySQL转换为SMALLINT
  • Laravel中注销时的验证错误
  • 用jquery json从php获取变量
  • 用于symfony 2.4.3的FOSUserBundle
  • PHP:通过索引将3个数组合并为一个多维数组
  • codeigniter哪里结果不起作用
  • PDO将默认提取模式设置为FETCH_UNIQUE
  • 表格仍然返回真值,即使有空()
  • 在PHP数据库查询中对项目进行分组
  • 许多关系拉拉维拉

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华