duanqun9618 2015-09-15 19:14
浏览 40

从codeigniter到laravel创建后备网址

we are using codeigniter as our current framework, but now we are working on laravel to enhance some features, but one of the problem we are facing is to give the fallback for old url use in codeigniter, our current url looks like

www.school.com/index.php/student/subjects/102030

how to convert this to this

www.school.com/students/subjects/102030

having problem dealing with index.php in our urls, as they are indexed in google which would really annoy them, and would be awful with seo

  • 写回答

1条回答 默认 最新

  • dongrong5189 2015-09-15 23:14
    关注

    You can use an .htaccess if you are using apache. After some tests something like this should work:

    RewriteEngine on
    RewriteRule ^index\.php\/student\/subjects\/([0-9]+)$ students/subjects/$1 [R=301,L]
    

    It's making a 301 redirection so the new urls replace the old ones in search engines after a while.

    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题