Friday, May 14, 2010

PHP redirect .. Make sure that you have only one site!

PHP redirect .. Make sure that you have only one site!
This is the first post in this topic, but believe me, it will be a massive section devoted to PHP / ASP. Htaccess PHPBB vbulleltin and booking diversion - 301 for SEO .. So I'm starting with some simple PHP, which forwards index.php to / from main domain .. It then stops, as in Google, Yahoo and MSN index www.soffts.ru and www.soffts.ru / index.php So at the very top of the page you need to add the following PHP


Site_base_url $ = 'http://www.soffts.ru; function assertProperURL ($ site_base_url, proper_url $) ( $ REQUEST_URI = $ _SERVER ['REQUEST_URI']; $ = $ Current_url site_base_url. request_uri $; if ($ current_url! = $ proper_url) ( header ("HTTP/1.1 301 Moved Permanently"); header ('Location:'. proper_url $); ) ) assertProperURL ($ site_base_url, $ site_base_url. '/', so)


Note: you must make sure that it is only on file index.php, rather than on any other file .. If you add this script to another file, then it is redirected to the TLD

No comments:

Post a Comment

Powered by Blogger.