Home › Forums › OS X Server and Client Discussion › Web › Redirect ASP not working
Hello all,
Need some help with redirecting requests for asp pages. We just took over a site that was previously built with .asp. Now we have the site on an XServe which doesnt run ASP but the client has some pages with high ranks in Google. So they want us to redirect those particular ones to the new files.
Problem is, I think Apache instantly throws a 404 since it cannot execute ASP. Can anyone confirm this?
The old URLs look like this:
http://www.activcarept.com/siteres.aspx?resid=128acdcb-dfa3-458c-90ce-42147f679c2f
So that one for example I need to go to
Click to access BackNeck-PT.pdf
I’ve tried all kinds of combinations of using Redirect, Redirectmatch etc. and none of them work. Any Apache gurus out there that can help me?
Some examples of what I’ve tried:
[code]
Redirect 301 /siteres.aspx?resid=128acdcb-dfa3-458c-90ce-42147f679c2f http://www.activcarept.com/images/uploads/BackNeck-PT.pdf
Redirectmatch 301 \/(.*)128acdcb-dfa3-458c-90ce-42147f679c2f http://www.activcarept.com/images/uploads/BackNeck-PT.pdf
Redirectmatch 301 \/(.*)128acdcb-dfa3-458c-90ce-42147f679c2f http://www.activcarept.com/images/uploads/BackNeck-PT.pdf
[/code]
I have two ways I’d approach this. The first is mod_rewrite. A quick tutorial is [url=https://portal.data-basics.com:443/tmtrack/tmtrack.dll?View&I=25195&T=1000]here[/url]. Using mod_rewrite you could map the .aspx pages to .php and then read the resid from the query string, and then start the download of the needed file.
The other way would be to map the .aspx file type to another scripting language. So when an aspx page is delivered it’s first run through an interpreter (such as php).
Does that make sense?
thank you for replying.
I did end up redirecting to a php script which pulls the ID, sends the 301 in the header and delivers the related pdf.
I just didn’t think it would send back the right header at the right time, but the SEO dude who wanted this done says it looks good so I’m considering it done.
thanks again for replying
it is due to the data base error check it out