Hello All, So currently i have a windows server with .asp web pages. My website is search engine optimised and indexed very well by google and more than 95% of my traffic is from google search. But now due to some reason i have to change the server to linux server and i wont be able to run .asp pages on it. I have manually designed and created my web pages and last year i tried using wordpress and the whole thing changed. My traffic and alexa rank dropped to lowest because all the indexed web page gave an page not found error. I changed back to my previous .asp pages and the traffic started rising. So now if i use .php pages or any cms for that website, then how can i redirect all not found error pages to the home page? Is it something related to custom error pages? Linux server has htaccess page and windows has web.config. I learned about web.config but not sure about how to do it in htaccess. Any suggestion how can i solve this server switch issue? I dont really want the traffic to drop.
Hi csreference, you can use htaccess mod rewrite with your pages when anyone visit non found page it will redirect to from 404 error to your home page Thanks
PHP and HTML redirects If you do not wish to use the .htaccess file to redirect your visitors, you can use another option - a PHP or an HTML file which will perform the actual redirection. Below are examples for both programming languages: * For PHP, create a file (index.php for example) and add the following lines in it: <?php header( 'Location: http://www.yoursite.com/redirect_location' ) ; ?> * For HTML, create a file (index.html for example) with the following content: <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://www.yoursite.com/redirect_location"> Here you have the option to delay the redirect by increasing the CONTENT variable. For example CONTENT=5 will delay the redirect for 5 seconds. How to redirect non-www URLs to www? In order to redirect all of the requests for yourdomain.com to www.yourdomain.com, you should set the appropriate rewrite rule. This can be done by adding the following lines at the beginning of the .htaccess file in your public_html folder: RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] From now on, when someone accesses http://yourdomain.com s/he will be redirected to http://www.yourdomain.com. Using this method is safe because it should not create any redirection loops nor it should interfere with other rewrite rules. May be this help you
But url redirecting is what google does not like right? Now sure but i have seen those websites which redirects to other location than that original url indexed by google are maked unsafe since that engine wont know where it might take the visitors from the url which is actually indexed by the engine. So i think only from the website configuration we can do that, like custom error pages. i am not sure, correct me.
well depending on how the URL structure is setup, why wouldn't you just make the php files end in .asp. keep the names the same and transition to using php. you can set .asp files to be parsed as .php through the apache configuration or htaccess. here's how to do it with .htm , .html files, just sub in .asp http://www.desilva.biz/php/phpinhtml.html then setup the pages on the new server after you change them over to php code of course. another option would be to explore setting up apache to serve ASP but odds are you would need the ability to configure the server (VPS or Dedicated).