Welcome to WebmasterWorld Guest from 34.204.173.36

Forum Moderators: bakedjake

Message Too Old, No Replies

Rewrite asp to php

Moving asp site to unix server

     
4:25 pm on Feb 8, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 4, 2001
posts:2297
votes: 100


I am moving a client of mine from a Windows server to Unix. We do not want to loose the SERP results with the .asp pages, so I would like to know if I can use the .htaccess file to rewrite to have .asp pages treated as .php? I know I cannot run ASP on Unix, I just want to keep the web address. I would rather not do 301 redirects.

Thanks
Marshall
9:49 pm on Feb 8, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15943
votes: 890


I would like to know if I can use the .htaccess file to rewrite to have .asp pages treated as .php

Sure, that's absolutely straightforward. It's a single conditionless RewriteRule. See you in the Apache subforum ;)
11:07 pm on Feb 8, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 4, 2001
posts:2297
votes: 100


Hi Lucy and thanks. I have done it before with .html treated as PHP, but I was not sure if the server would freak with .asp. Now all I have to do is re-code everything.

Marshall
12:47 am on Feb 9, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15943
votes: 890


I was not sure if the server would freak with .asp

What the server doesn't know won't hurt it. You could request
example.com/disgusting-ethnic-slur/horrible-vile-obscenity/garbage-text.xtn.html.otherxtn.asp.php.net.zip.tar.gz.htm
and as long as it gets rewritten to
/nicepage.xtn
that's all the server will ever see.

Now all I have to do is re-code everything.

Pah, trivial ;)
3:27 am on Feb 9, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Sept 4, 2001
posts:2297
votes: 100


Pah, trivial
Maybe, but I was hoping for a quick and simple move, not something I actually hard to put work into. This one is not billable.

Marshall
8:08 am on Feb 9, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15943
votes: 890


The Regular Expression is your friend. A while back, I translated a bunch of old games from FutureBasic to javascript. An amazing lot of it came down to globally changing the exact syntax of control structures. Here a parenthesis, there a curly brace; here an "else", there an "XELSE". For/Next loops were a particular pain.