dongpo2002 2010-11-18 15:37
浏览 42
已采纳

PHP与ASP混合

I have a problem, just redone a homepage that was in ASP (ASPX) to a PHP. The problem is that i have some links out there that gos like this www.example.com/work.aspx?jid=23 .

I need to take controll over the links a redriect them to the main page.

How to do that? I have created a work.aspx file that i have written som text just for test. When i try to change the file content to do a "Response.Redirect" the file dosent seam to update.. Why?

Regards

  • 写回答

1条回答 默认 最新

  • douxin9135 2010-11-18 15:42
    关注

    You'll want to do that with .htaccess, not .aspx. Remove your .aspx file

    Create a file called .htaccess

    Put this in it:

    RewriteEngine On
    RewriteRule ^work.aspx$ work.php%{QUERY_STRING} [L,NC,R=301]
    

    This should take www.example.com/work.aspx?jid=23 and make it www.example.com/work.php?jid=23

    It'll also throw a 301 header telling search engines that the URL has been permanently moved.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改