Answer the question
In order to leave comments, you need to log in
How to turn /help.php?page=somePage link into /help/somePage? (apache mod_rewrite)?
There is a simple PHP code that takes files from a folder and displays them:
<?php
error_reporting(0);
$page = $_GET['page'];
if (file_exists('help-pages/'.$page.'.php')) {
include('help-pages/'.$page.'.php');
} else {
echo "not found";
}
?>
Answer the question
In order to leave comments, you need to log in
In .htaccess:
RewriteEngine on
RewriteRule ^help/(.*)$ /help.php?page=$1
Why do you need it? I never understood it.
Well, write $_SERVER['REQUEST_URI'] inside php and that's it, what's the problem?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question