dongshike7171 2012-07-18 12:48
浏览 26

在URL重写htaccess方面需要帮助

Hi everyone, I need help regarding URL Rewriting My actual url is {www.mysub.domain.com/other?Name=Some Product Name&code=12312312} After adding codes in .htaccess file url would be {www.mysub.domain.com/other/Some Product Name/12312312}. This is working fine on my localhost but giving error on my domain host. Below is my codes, Review it and let me know is error. I appreciate your help.

<pre>
RewriteEngine on<br>
RewriteRule ^itm/([A-Za-z0-9\s+!@$%&*._%+-/\(){}#='"`~|;:<>]+)/([0-9]+)$ itm.php?ItemName=$1&code=$2<br>
</pre>

Thanks.

  • 写回答

1条回答 默认 最新

  • duanhan7001 2012-07-18 13:07
    关注

    Try using the following:

    Options +SymLinksIfOwnerMatch
    
    RewriteEngine on
    
    RewriteRule ^([a-zA-Z-]+)$ index.php?action=$1 [NC,L]
    
    RewriteRule ^(member)-([0-9-]+)$ index.php?action=member&id=$2 [NC,L]
    
    RewriteRule ^([a-zA-Z-]+)/([a-zA-Z-]+)-([0-9-]+)$ index.php?action=$1&saction=$2&sid=$3 [NC,L]
    
    RewriteRule ^([a-zA-Z-]+)/([0-9-]+)$ index.php?action=$1&id=$2 [NC,L]
    
    RewriteRule ^([0-9-]+)/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/(.*).html$ index.php?action=details&id=$1&p1=$2&p2=$3&p3=$4 [NC,L]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真