Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
You need to do the opposite - redirect all URLs to index.php
For example, somewww.ww/bla/bla
# .htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?query=$1
<?php
/**
* index.php
*/
echo $_SERVER['QUERY_STRING']; // => 'query=/bla/bla' преобразованный URI
echo $_SERVER['REQUEST_URI']; // => '/bla/bla' оригинальный URI
var_export($_GET); // => array('query' => '/bla/bla')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question