I have a problem when showing pdf files, in my htaccess I have this:
RewriteRule ^([a-zA-Z0-9/]+)$ index.php?view=$1
Everything is working well for me, but at the moment of sending a url like this:
href="files/RAD.pdf/"
href="files/archivo.pdf/"
There the problem appears to me and it is that it sends me to page 404, that the route does not exist, I think the problem is that my htaccess does not allow .-_&()
or any special character. I've been looking for how to do it but without success.
And my index.php I have it in this way to link the views according to the URL that is happening:
<?php
require('config/Config.php');
if (isset($_GET['view'])) {
$views = explode("/",$_GET['view']);
if ($views[0]=="admin") {
$ruta = $views[1];
} else {
$ruta = $views[0];
}
if (is_file('enrutadores/'.$views[0].'/'.$ruta.'Enrutador.php')) {
require('enrutadores/'.$views[0].'/'.$ruta.'Enrutador.php');
} else {
include('vistas/404.php');
}
} else {
include('enrutadores/indexEnrutador.php');
}
?>
Thanks for the help!