0
Hello, I’m trying to use htacess with variais, but I’m not succeeding.
my htacess ta thus
RewriteEngine On
RewriteRule ^$ /site/
RewriteRule ^index$ /site/index.php
RewriteRule ^continue/([a-zA-Z0-9]+)/$ /site/continue.php?id=$1 [QSA]
but the continue does not work, the 404.
and to redirect to this page is like this
header("Location: ../continue/".$id);
the intention is to redirect everything to a folder '/site/'?
– Daniel Omine
Not necessarily related to the problem, but avoid relative paths in Location. The ideal is to always use the full path
header('Location: //example.com/caminho/caminho/'.$id);
(although rfc7231 revised the tolerance for this, it was only in 2014), or at least based on the root:header('Location: /caminho/caminho/'.$id);
, remembering that the name of the site you can take from the environment itself, to be portable solution.– Bacco