Text Resizer Text Resizer
February 7th, 2012
You're browsing: Scriptmatico.Com » General » Redirecciones con php & apache

Redirecciones con php & apache

Posted on mar 07 in Generalby PrintText Resizer Text Resizer

Redireccionar en php es muy simple solo tenemos que usar la funcion header de php junto con un string indicandole la localizacion a la cual deseamos redireccionar.

PHP:
  1. header('Location: http://www.url-al-cual-redireccionamos.com');
  2. //es muy importante poner Location:

Ahora en apache es necesario crear un archivo .htaccess(no un archivo con extensión .htaccess ya que seria erroneo poner archivo.htaccess).
y poner dentro de el archivo


Redirect permanent / http://ejemplo.com/

si deseamos un directorio en particular pondriamos


Redirect permanent /directorio http://ejemplo.com/

igual podemos hacerlo con


RedirectMatch permanent ^(.*)$ http://www.videoflog.net/

Related posts:

  1. Proteger Directorios Con Apache y php usando .htaccess y .htpasswd
  2. Crear archivos ZIP y TAR con PHP (Crear archivos comprimidos)

Leave a Reply

You must be logged in to post a comment.

Back to Top