dqve65954 2015-08-05 20:17
浏览 100
已采纳

如何删除URL中的参数.htaccess [关闭]

I have a very big problem, I'am using to CLEAN URL this link.We are make a small CMS system for PHP and make a new web site.

Problem is, my customer.

My customer don't want these link style :

www.example.com/page/about-us
www.example.com/page/contact-us
www.example.com/anotherpage/lorem-ipsum-dolar

How to remove or hide /page, /anotherpage using .htaccess ?

My .htaccess file is ;

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.php [L]
</IfModule>
  • 写回答

1条回答 默认 最新

  • duankuai6991 2015-08-05 20:53
    关注

    You can probably use .htaccess Rewrite rule to solve this issue:

    RewriteRule url-wanted$ actual-url [L,QSA]
    

    Example:

    RewriteRule www.example.com/about-us$ www.example.com/page/about-us [L,QSA]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题