Hola!
Digamos que tenemos nuestro sitio aquí:
http://www.mi-sitio.com.mx/nuevacarpetaraiz/
Pero queremos que cuando el usuario entre a
http://www.mi-sitio.com.mx, sea redirigido a la carpeta
nuevacarpetaraiz, pero
sin que en la URL se vea dicha carpeta.
Tengo el script que hace tal cosa para dominios
WWW, y funciona. Pero, ¿cómo hacerlo con direcciones
IP?
Digamos que mi sitio es
http://108.177.186.89/~misitio/
El siguiente HTACCESS es el que me funciona, siempre y cuando la URL sea del tipo:
http://www.mi-sitio.com.mx/, y no una IP.
Ya probé cambiando
mi-sitio.com.mx por
108.177.186.89 Pero desde luego no funciona :(
Código htaccess:
Ver original# BlueHost.com
# .htaccess main domain to web redirect
# Do not change this line.
RewriteEngine on
# Change mi-sitio.com.mx to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?mi-sitio.com.mx$
# Change 'nuevacarpetaraiz' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/nuevacarpetaraiz/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'nuevacarpetaraiz' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /nuevacarpetaraiz/$1
# Change mi-sitio.com.mx to be your main domain again.
# Change 'nuevacarpetaraiz' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?mi-sitio.com.mx$
RewriteRule ^(/)?$ nuevacarpetaraiz/index.php [L]
Saludos!

