dshgdhdfcas30210 2015-08-23 01:53
浏览 231

找不到对象! 网址重写

I have rewrited my url's with htaccess and now I the following URL

This is my old URL:

http://example.com/user.php?username=collins1

The new URL:

http://example.com/user/collins1/

The .htaccess file:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^user\.php$ %{QUERY_STRING} [C]
RewriteRule ^username=(.*) /user/$1/? [R=301,L]

It get an Object not found! response, kindly help

  • 写回答

1条回答 默认 最新

  • dpbfb7119 2015-08-25 02:59
    关注

    You are redirecting not rewriting your url, for internal rewrite use this

    RewriteEngine On RewriteRule ^user/([^/]*)/$ /user.php?username=$1 [L]

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器