douzhuangxuan3268 2013-09-03 16:48
浏览 20

RewriteCond不会重写我的URL,而是抛出错误500

I am trying to strip out a single level of my new written directory to avoid repetition of entity names in my URL. The specific name of "Well service" is duplicated as I am passing both the page category and pump category to the URL to render the page and perform relevant queries.

My current URL looks like this

http://mysite/Wellservice/Well-Service/PumpID01

Although this is not a major problem from an aesthetic perspective I would like to clean the URL up further by stripping one level of "Well Service" from the URL to create something that looks like this:

http://mysite/Well-Service/PumpID01

I have tried to build a query to handle this but it causes the server to respond with an Error: 500, my query can be seen below:

RewriteCond %{QUERY_STRING} ^?id=([\w-]+)&s=Wellservice&c=(Well-Service)$
RewriteRule ^product.php/?$ /Pumps/%2/%1/? [R=301,L]

Have I done something wrong in my code for the Error 500 to be returned, or is it not possible to do what I am trying to do.

NOTE:

  • Variable "id" = the pumps id to query the database
  • Variable "s" = the category the pump belongs to to refine query result
  • Variable "c" = the page category to generate any page specific styling including active state
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?