Migrate a WordPress site from Alibaba Cloud SAS to ECS

Terms like “Cloud Computing“, “Cloud Server“, “Virtual Machine” or “Database” could be daunting for someone who is just starting. This is why I completely understand the people who are having a hard time deciding whether or not create a blog or e-commerce site. Even if you’re not an IT expert and have never created a cloud […]

Country detection via PHP

Imagine a example.com with some example.com/es, example.com/fr with content related to each country. One solution is a javascript-based country detector that could ask the visitor to change the current site to the most appropriate one regarding to the visitors origin. The problem with this solution is that the user needs to load the content twice, and […]

How to create a Template in WordPress without FTP Access

You want to create a Template in your theme, and somehow you don’t have FTP access in that moment. But, hey, you have the WordPress logins to enter in the backend, so… stay tuned! 1 Indentify the theme directory To know the directory in which the theme is located, you will need to see the source […]

¿Qué hora es?, ¿qué color es?

Hoy os traigo algo interesante, aunque sea una chorrada como una casa. Pero bueno, para eso está el blog, ¿no? Se trata de una combinación CSS+PHP+Javascript que hace cambiar el color del cuerpo del documento de forma dinámica según la hora en la que estemos. ¿Cómo lo hace? Como ya sabemos, el color se puede […]

Dinamize the content with PHP

One way to do more dinamyc our pages, write less code and simplifying the architecture of the files is using PHP. You can use CSS3 to make the web coolest than others, but the content can be dinamized linking many files. Imagine that you have a master ‘index.php’ with a space to include the content. You […]

Insert a file with PHP

There are situations in wich we want to edit separately the content of a website instead to edit all in one file. <?php include ‘FILE.inc’; ?> For me it’s more comfortable edit the files in parts. We can make a file like this: <!DOCTYPE html> <html> <head> <?php include ‘head.inc’; ?> </head> <body> <?php include ‘body.inc’; ?> […]

Auto-updating copyright year in footer with PHP

Usually we visit some pages in which the year in the footer isn’t the current year. This recurrent problem can be easily solved replacing the current-year-place with this PHP code: <?php echo date(“Y”); ?> Simple as milk.

301 Variable Redirection with PHP

Yesterday I posted “301 REDIRECTION WITH PHP“, a mini how-to where I explained how to make a permanent redirection with PHP. But, if your case is similar to mine, that code it is not sufficient, and we must make a different redirection for each URL request. To do that in one file, you must write the […]

301 Redirection with PHP

Sometimes you might want to redirect your visitors to a new URL address. One reason you may want to do this is that the page they are trying to access no longer exists. There are 3 types of redirection, 301, 302 and 303. ‘Redirection 301’ is for that pages that are moved permanently. In PHP, […]

Cómo montar un servidor web DIY

Cada vez es más asequible y fácil montar un servidor casero en casa, ya que casi todos tenemos un viejo ordenador por el desván o tirado en una esquina de casa, y si no podemos conseguir uno por menos de 30€ en eBay. Basándome en mis experiencias, explicaré más o menos qué pasos hay que seguir […]