Hello All, DP Members, my client site : http://www.online-web-ratings.com/ [ i have to solved the query for redirect non www to www just for main domain name] but my query is p'se open these link : http://www.online-web-ratings.com/web-design-ratings/ i want to redirect a above url like : http://www.online-web-ratings.com/web-design-ratings [ without / ] so p'se give me idea and provide me .htaccess code for redirection P'se reply ASAP
you want it to redirect permanently, temporarily etc for the search bots and all? or do you just want a simple code to redirect without affecting much else? if you just want the code it has to come before Headers. (at the very top of your page -whatever you use, i use notepad, so at top of notepad.. with no space ...begin code at the FIRST line something like this <?php header('location: http://www.yourredirectsite.com'); ?> When that page loads, it'll read that code, and redirect. You can use that code anywhere in your PHP scripts .. AS LONG AS your scripts dont echo, print, or write or perform any functions on that page. Otherwise you'll get the error = Error : Headers already sent ..blah blah
If you want to redirect non-www to www. theres a way to do it in the .httaccess BUT.. many say its not a good thing to do ..since search engines keep track of both non-www and www and thatit could perhaps shut down half or more of your traffic. I never got into it enough to see if it did any damage. But the code looks like this in .htaccess also want to probably skip a line at last line on .htacces Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite.com [NC] RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
hello ezprint2008 i can already put these code [ non www to www ] into my .htaccess file and working perfectly suppose u can open my site link : http://www.online-web-ratings.com/ than u can remove the www so it can redirect direct the www [ so is it working ] but i want to redirect inner pages like : http://www.online-web-ratings.com/web-design-ratings/ to http://www.online-web-ratings.com/web-design-ratings [ without / ] so in these above code which new line add and give some new code for removing / and than working perfectly also provide me new .htaccess code for these query thanks a lot for give me suggection for non www to www p'se reply ASAP
to remove the / from the end? type some of these: yahoo.com google.com youtube.com check out what happens to the end of their URL