dptiq46022 2013-05-26 03:29
浏览 86
已采纳

指向同一网页的多个链接

I want to make a script which will have generate random links to the same page. I know I can use a random generator for random alphanumeric string but how can I implement that and redirect it to the same page.

For example:

  • www.domain.com/12345
  • www.domain.com/23412
  • www.domain.com/86756

All these links should be redirected when clicked to the same page, www.domain.com. How can I do that?

  • 写回答

3条回答 默认 最新

  • dqk42179 2013-05-26 03:36
    关注

    Really depends on how you envision your urls. One simple way could be

    http://www.domain.com/page/1234
    http://www.domain.com/page/5432
    

    If you are ok with that url structure, then you can do a htaccess rewrite to point all requests containing /page/ to the same place.

    It would be something on these lines

    RewriteRule ^/page/(.*)$ common.php
    

    The idea is to have something in the url that is common across all the urls, in this case its 'page'

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试