0
Good afternoon,
I have a website that needs to have the English version, so I thought I would have a folder /Eng/ and just change this url but the site in Portuguese I already use htacess to have friendly url that inside the normal root pulls the pages from inside a folder called /pages/ and then I need to make when it is in English it pull inside the folder /Eng/pages/.
I’m trying to do but he can’t load the page in the right folder.
My . htacess
RewriteEngine On
RewriteRule %{REQUEST_FILENAME} !-f
RewriteRule %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z_-]+)\/?$ index.php?page=$1 [NC,L]
RewriteRule ^eng/([a-z_-]+)\/?$ index.php?page=$1 [NC,L]
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>
My index
<?php
require 'header.php';
include $url.$page;
require 'footer.php';
?>
I have an argument that generates the variable $page
$page = (isset($_GET['page']) and !empty($_GET['page']))? "pages/{$_GET['page']}.php" : "pages/home.php";
if (!file_exists($page)): $page = "pages/404.php"; endif;
If anyone can give me a light I’d appreciate it.
It seems that your site is vulnerable to PHP Injection
– Costamilam
Hello William, thanks for the tip, but taking advantage I always thought I should worry about this type of security when there was some connection with sql, mysql, IE, login or panel this kind of things. I’m thinking wrong?
– Erlon Ferraz
From a look at the link, PHP Injection is different from SQL Injection. With it an attacker could delete all files from your server, even if there is no database connection, it is not very interesting to lose static files
– Costamilam
Ahhhh show then, I’ll take a look yes, thank you very much.
– Erlon Ferraz