Forum Moderators: open
If its ASP, or ASP.NET a simple .asp or .aspx file with the following will suffice.
<% response.redirect("http://www.somewhere.com/") %>
If you only have html a meta refresh can do it.
<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.htmlhelp.com/">
PHP and the rest of the popular technologies can do the redirect VERY easily as well.
If your web host has custom errors, then anytime you got an error you could redirect somewhere else.
Hope this helps.
So, since they are PHP pages, whats is the best way to redirect visitors to the new html pages.
for example
old page was www.mysite.com/widgetpage.php
new page is www.mysite.com/widgetpage.html
The reason why im not making php pages anymore is cuz I have noticed that some visitors get scared linking to a page with an extension they dont recognize.
Thanks for the help.
Example if I paste this into the head tag of widget.php
it will jump right to widget.html cos it doesnt match the address in the script.
<SCRIPT LANGUAGE="JavaScript" type="text/JavaScript">
<!--
if ((self.location!= 'widget.html') && (top.location == location)) {
self.location = 'widget.html';
}
//-->
</SCRIPT>
From Google search:
link:www.domain.org/dir/file.php
This might not be do-able with so many pages, but it works in certain situations. AFAIK it is case sensitive and results aren't updated immediately so this can create inaccurate results.
If you're running Apache, you can use the following line in your .htaccess (if you have mod_rewrite loaded):
=== CUT HERE ===
RewriteEngine On
RewriteRule /(.*) http://new.site.com/$1 [RL]
=== CUT HERE ===
This will cause apache to redirect all requests to the new target domain. Of course, redesigns are rarely that simple, so you might want to look at the "mapping" facility of mod_rewrite to do the dirty work.
The details of the RewriteMap command require far too much Black Magic for me to summarize here, but you can read for yourself how you can map lists of URIs to alternates at [httpd.apache.org...]