2 Replies - 3179 Views - Last Post: 14 April 2012 - 05:05 AM

#1 UziTech  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 64
  • Joined: 26-October 10

htaccess rewrite .aspx to .php

Posted 13 April 2012 - 01:28 PM

I switched my site to php from asp.net now i get alot of 404 errors on old .aspx pages

RewriteRule ^(.+)\.aspx$ $1.php [R=301]


I tried the rule above which almost works. It turns

www.***.com/index.aspx


into

www.***.com/full/path/on/the/server/index.php


how do i get rid of the server path?

Is This A Good Question/Topic? 0
  • +

Replies To: htaccess rewrite .aspx to .php

#2 UziTech  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 64
  • Joined: 26-October 10

Re: htaccess rewrite .aspx to .php

Posted 13 April 2012 - 01:33 PM

I just found the answer

RewriteBase /
RewriteRule ^(.+)\.aspx$ $1.php [R=301]



"RewriteBase /" made it work
Was This Post Helpful? 1
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: htaccess rewrite .aspx to .php

Posted 14 April 2012 - 05:05 AM

Thread moved into the Web Servers and Hosting forum. This isn't really a PHP issue.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1