Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
lsri8088 is on a distinguished road
 
Posts: 6
Join Date: Jun 2012
Question htaccess y redirecciones - 06-06-2012, 07:21 PM

Hola,

TEngo las redirecciones que indico abajo. En mi ordenador funcionan correctamente pero en 000webhost no.

La url www.lsri8088.com/home.html, debería redireccionar en primer lugar a /home/home.html, luego a public/home/home.html, y finalmente cambiar .html por .php.

¿Que puede estar mal? ¿Porque no funciona en este servidor?

Gracias

Code:
# by webhosts
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /public


Options +FollowSymlinks

# indica la página a mostrar como indice del directorio, si no existe, muestra el listado del directorio (archivos y carpetas)
# comprueba la existencia de las páginas en el orden indicadas
<IfModule dir_module>
   DirectoryIndex home.php /public_html/e404.php
</IfModule>

#Deshabilita mostar el directorio
Options -Indexes

ErrorDocument 404 /e404.html

# ****************** PHP **********************
php_flag display_errors on
php_value auto_prepend_file "/home/<MY_USER>/public_html/private/common/init.php"
# *********************************************

# ************** REWRITE *****************************

# ACCESS FORBIDDEN
RewriteCond   %{REQUEST_URI}	^/private/(.*)$
RewriteRule ^(.*)$	- [R=404] 

# go home
RewriteCond   %{REQUEST_URI}	^/$|^/home.html$
RewriteRule ^(.*)$	/home/home.html


# go home of folder
RewriteCond   %{REQUEST_URI}	^(.*)/$
RewriteRule ^(.*)$	$1/home.html

RewriteCond   %{REQUEST_URI}	^/nacimientos/(.*)$
RewriteRule ^nacimientos/(.*)/(.*)/fotos.html$ /public/nacimientos/fotosIndex.php?belenYear=$1&belenType=$2 [L]

# documment root of URI to /public/
RewriteCond   %{REQUEST_URI}	!^/public/(.*)$
RewriteRule (.*)	/public/$1 [P,L] 

# .html to .php
RewriteRule ^(.*)\.html$	$1.php	[NC]
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
Senior Member
jpardo is on a distinguished road
 
Posts: 892
Join Date: Aug 2009
Default 06-06-2012, 08:54 PM

creo que no deberias incluir la ruta public_html
Reply With Quote
(#3 (permalink))
Old
Junior Member
lsri8088 is on a distinguished road
 
Posts: 6
Join Date: Jun 2012
Default 06-06-2012, 09:11 PM

Quote:
Originally Posted by jpardo View Post
creo que no deberias incluir la ruta public_html
¿Donde no debo poner "public_html"? ¿En el IF Module?
Reply With Quote
(#4 (permalink))
Old
Senior Member
jpardo is on a distinguished road
 
Posts: 892
Join Date: Aug 2009
Default 06-06-2012, 09:31 PM

si y en todas las referencias
Reply With Quote
(#5 (permalink))
Old
Junior Member
lsri8088 is on a distinguished road
 
Posts: 6
Join Date: Jun 2012
Default 06-06-2012, 09:50 PM

Quote:
Originally Posted by jpardo View Post
si y en todas las referencias
Lo he quitado del If Module:
<IfModule dir_module>
DirectoryIndex home.php /public/e404.php
</IfModule>

Pero de "php_value auto_prepend_file" no puedo quitarlo, ahi hay que dejar la ruta real y absoluta del archivo. Si la dejo relativa no funciona.

¿ el "RewriteBase /public" es correcto ?

000webhost.com lo pone así "RewriteBase /" y dice que no se elimine esa linea.

Gracias.
Reply With Quote
(#6 (permalink))
Old
Senior Member
jpardo is on a distinguished road
 
Posts: 892
Join Date: Aug 2009
Default 06-06-2012, 09:55 PM

¿ el "RewriteBase /public" es correcto ? aparentemente si, por esa carpeta existe

saludos
Reply With Quote
(#7 (permalink))
Old
Junior Member
lsri8088 is on a distinguished road
 
Posts: 6
Join Date: Jun 2012
Default 06-06-2012, 10:07 PM

Sí, la carpeta "public" existe, colgando directamente de "public_html".

No se, es muy raro, y no se como reproducir el error en mi ordenador. :'(

Por cierto, jpardo, muchas gracias. Buenas noches

Last edited by d3iti; 08-05-2012 at 07:33 AM.
Reply With Quote
(#8 (permalink))
Old
Junior Member
lsri8088 is on a distinguished road
 
Posts: 6
Join Date: Jun 2012
Default 08-02-2012, 06:23 PM

Hola,
¿Alguna idea para soluconar esto?

Da la impresion de que no funcionan las redirecciones

Graicias

[38 minutos más tarde]

Hola,

Ya lo he solucionado.

Me faltaba el "RewriteEngine on" y quitar la "bandera" P

Last edited by d3iti; 08-02-2012 at 07:37 PM.
Reply With Quote
Reply

Tags
htaccess redireccion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com