dqeq885710 2018-10-22 09:46
浏览 45

在Profile.php上隐藏参数并在页面上启用斜杠

Let website link is www.abc.com I have 2 PHP Files.

home.php profile.php

  1. I want to remove .php and place slash on end
  2. profile.php url (before - "www.abc.com/profile.php?id=no1") to "www.abc.com/user_name" (or "www.abc.com/abrar" or "www.abc.com/jahin" or "www.abc.com/piash" like this)
  3. I want to add slashes also on profiles "www.abc.com/user_name/"

    I am currently using this htaccess config but when i put slahes on www.abc.com/user_name it makes error

    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}.php !-f
    RewriteRule ^(.+)$ /profile?uid=$1 [L,QSA]
    

I am using RAW PHP.

Can anyone help me please?

Thanks in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?