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 redriec开发者_如何学JAVAt 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
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.
精彩评论