Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Never ending publicpublicpublicpublic... redirection
23-Mar-2012, 08:39 AM
Post: #1
Never ending publicpublicpublicpublic... redirection
Hi all again. This topic is delicate and very important from my point of view, so I'm going to write in my native language and then I'll try to translate. Please!! Apply these changes on your own risk.

En ocasiones hay ciertos enlaces que generan un error de redirección y la barra de direcciones del navegador muestra una direccion con infinidad de "publics", como por ejemplo 500.shtmlpublicpublicpublicpublicpublicpublicpublicpublic...

Esto ocurre por un error en el fichero .htaccess de la raíz. El fichero original contiene:
Code:
RewriteRule ^(.*)$ %{REQUEST_URI}public [R,NC,L]
¿Qué significa esto? Que cualquier dirección la redirija a direccionpublic. Por ejemplo, si la aplicación trata de ir a http://www.misitioweb.com/cms/index/id/1, la dirección se cambiará a http://www.misitioweb.com/cms/index/id/1public. Esta última dirección no existe, por lo que el servidor tratará de redirigirte otra vez añadiendo un nuevo "public" al final (http://www.misitioweb.com/cms/index/id/1publicpublic), y luego otra vez, y otra, hasta que el servidor lanza un error.

Solución

Sustituir esa línea por esta
Code:
RewriteRule ^(.*)$ /public%{REQUEST_URI} [R,NC,L]
que, usando el ejemplo anterior de la dirección http://www.misitioweb.com/cms/index/id/1, te redirigiría a http://www.misitioweb.com/public/cms/index/id/1, dirección que sí es correcta.

Espero que algún administrador valide esta modificación o la rebata.

POOR ENGLISH
Sometimes there are certain links that generate a redirection error and the address bar of your browser shows an address with lots of "publics", such as 500.shtmlpublicpublicpublicpublicpublicpublicpublicpublic...

This occurs due to an error in the file. Htaccess file. The original file contains:
Code:
RewriteRule ^(.*)$ %{REQUEST_URI}public [R,NC,L]
What does this mean? That the redirect to any direction [i]URL[/ i] public. For example, if the application is going to http://www.mywebsite.com/cms/index/id/1, the address is changed to http://www.mywebsite.com/cms/index/id/1public . The latter address does not exist, so the server tries to redirect again by adding a new "public" at the end (http://www.mywebsite.com/cms/index/id/1publicpublic), then again, and another, until the server throws an error.

Solution
Replace that line with this
Code:
RewriteRule ^(.*)$ /public%{REQUEST_URI} [R,NC,L]
Using the above example http://www.mywebsite.com/cms/index/id/1 address, you redirect to http://www.mywebsite.com/public/cms/index/id/1, wich is correct.

I hope an administrator validates or refutes this change.
Find all posts by this user
Quote this message in a reply
23-Mar-2012, 11:05 AM
Post: #2
RE: Never ending publicpublicpublicpublic... redirection
This is a valid modification. On some servers a slash (/) is necessary.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Redirection problem akhasis 13 15,503 26-Mar-2012 01:38 AM
Last Post: akhasis

Forum Jump:


User(s) browsing this thread: 1 Guest(s)