Answer the question
In order to leave comments, you need to log in
How to show pages with mod_rewrite?
htaccess contains:
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)$ urltest.php?post=$1
<?php
$page = $_GET['post'];
if ($page === 'about') {
require 'about.php';
}else if ($page === 'main') {
require 'main.php';
}else {
/* и тд. и тп.*/
}
?>
Answer the question
In order to leave comments, you need to log in
httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rew...
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question