I have a web that manages a session variable in all the modules, this helps me to recognize the user that this "logged in" I have to change the normal to friendly url's, and I am helped by the RewriteRule. for the moment I managed to generate the friendly url with everything and the session made staying like this:
http://mi-sitio.com/inicio/jlllURL3Hf/
Where "jlllURL3Hf" is extracted from the DB as the session already "logged in"
ok, while the session exists and the variable is being collected by the pages, there is no problem
the problem is preceded, at the moment I need to see the page without the session done, as any user who enters for the first time, by not having the variable made by the session, simply the friendly url does not work throwing a error 404
.
This is the way I have the .httaccess
until now.
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule acerca/(.*)/(.*) empresa.php?scid=$1&id=$2
RewriteRule contact/(.*)/(.*) contacto.php?scid=$1&id=$2
RewriteRule inicio/(.*)/(.*) index.php?scid=$1&id=$2
RewriteRule tienda/(.*)/(.*) productos.php?scid=$1&id=$2
RewriteRule novedades/(.*)/(.*)/(.*) productos.php?scid=$1&id=$2&new=$3
RewriteRule promos/(.*)/(.*)/(.*) productos.php?scid=$1&id=$2&promo=$3
RewriteRule catalogo/(.*)/(.*) descripcion_producto.php?scid=$1&id=$2
RewriteRule preguntas_frecuentes/(.*)/(.*) faqs.php?scid=$1&id=$2
Obviously there is something more than devo add to the code of htaccess
, but do not hit the spot.