If your site is moved to a new domain with the same file structure as before you can use this code to redirect to the new location. Works well for content management systems like wordpress even without .htaccess
<?php
$url=$_SERVER['REQUEST_URI'];
$url=substr($url, 0, -1);
$url_new=”http://newdomain.com$url/”;
header(”HTTP/1.1 301 Moved Permanently”);
header(”Location: $url_new”);
exit();
?>
Place the above code before outputting html (Even before <html>).
What silly thing does this do ?
It does silly thing of concatenating the file name part in old domain to new domain and redirect the visitors and search engines. Since its server side redirect its search engine friendly and you won’t lose search engine juice.
Oh there are two methods to remove raquo; from the title of wordpress posts.
1.
Instead of wp_title() in your theme’s header file (header.php) put echo wp_title(”,true);
This method is the easiest one to do, it just strips off the raquo; inserted by wordpress.
2.
Second method is to find that particular file in wp-includes thats inserting raquo; into title and removing raquo; from it. I have done it in previous versions of wordpress ( haven’t tried in 2.7) and feeling bit lazy to search for it. Hakuna matata as long as first one serves my purpose.
Second one is really an elegant way, try it yourself in your free time. Post a comment if you can spare minutes to tell others.
Find the line
wp(”post_type=post&what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby”);
Its 805th line in wordpress 2.7, line number might be different in different versions, so better find (CTRL+F) the line of code above in wp-admin/includes/post.php
Replace 15 in posts_per_page=15 by some higher number you wish, Lets say 50, the code code after change must look like this
wp(”post_type=post&what_to_show=posts$post_status_q&posts_per_page=50&order=$order&orderby=$orderby”);
While retrieving Greek/ Arabic/ Russian language or some other non english character data from database there is possibility that the data may appear as question marks (??????) instead of the original data, Usually you will be having data in its original language neatly stored in database, but for some strange reasons php is displaying it as ?????? when queried.
This problem actually happens because you have not explicitly mentioned the character set inside your php code. Here are two things you must do to solve your problem.
Put this meta tag inside head tags
<head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8" /> </head>
Use mysql_query("SET NAMES 'utf8'"); before the query to databasemysql_query("SET NAMES 'utf8'");
$new_database_content=mysql_query("select * from (….) where (….) ");
Tags: Character encoding problem
Symlinks ( symbolic links / soft links ) are the shortcuts to another file or directory, Here I’m referring to the symlinks that you usually see in a FTP account ( not to be confused with the shortcuts used in a PC ).
You can not usually delete symlinks by
- Using control panel provided by your host.
- Using internet explorer to accesss ftp account.
- Using a random ftp client that only supports ftp.
- Changing file permission (eg: changing to 777 ) and trying to delete.
How to delete symlinks
- Use a proper ftp client software that supports SFTP/SSH mode file transfer. Use Winscp or filezilla . I have tried winscp and mostly filezilla too works in sftp mode.
- Use shell commands to remove the symlink, eg 1: use “rm /www/public_html/~folder_name” instead of “rm ~folder_name” to delete the file along with the folder. eg2: use “unlink symbolic-link” .
Once you remove Symlinks it will be easy to delete the containing folder, try it.