Unix command to delete .svn folders

I have found on the web a useful command to delete .svn folders in your local svn repository. I found it here.

The command line is as follow :

find ./ -name .svn -exec rm -rf {} \;

The command find will search in the ./ directory each element whose -name is .svn. Don’t forget to go into your svn directory with the cd command. After each successful research, the -exec command will execute rm -rf with the path found by find put into the {} brackets. The result is that each .svn folder found is deleted.

HTML Redirection

My first useful post will talk about Html Redirection. It’s useful to know how make redirection.

Why do we need this stuff?

For instance, if you have moved an html page, but too many links point on this, you have to make a redirection page. If you are using a domain but your website is somewhere else, you can use this. If your website is in one folder, you can also do this.

So, I’m going to make it simple. There is 3 ways to make a redirection. The first one is to ask people to click on an link, like this : <a href="http://bastienpaul.fr/wordpress">Please go here</a>

The second way is to write this line in the head of the Html page : <meta http-equiv="refresh" content="0; url=http://bastienpaul.fr/wordpress" />

With this method, you can chose the time the redirection can make in content attribute. In the example above, the redirection is effective as soon as the page is loaded. If you want the redirection to be effective in five seconds, you have to write the line like this : <meta http-equiv="refresh" content="5; url=http://bastienpaul.fr/wordpress" />

The third way is the quickest way to make a redirection. You can write directly in the Html header with PHP to make a redirection. This is a code example :

<?php
//The order of lines bellow is important for compatibility
header('Location:http://www.bastienpaul.fr/wordpress '); //New address
header('HTTP/1.1 301 Moved Permanently');
header('Status: 301 Moved Permanently'); //For compatibility
?>

Notice that for using php code, you have to create a PHP file. For instance : index.php

I’m using this code for my website. So, it’s working 😉