Answer the question
In order to leave comments, you need to log in
How does .htaccess work?
In the address bar I enter draft.local/test.php . There is such .htaccess
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} !/test\.php
RewriteRule .* test.php
$host='localHost';
$user='root';
$pass='';
$dbName='testDB';
$table='site';
$link=mysqli_connect($host, $user, $pass, $dbName);
mysqli_query($link, "SET NAMES 'utf8'");
$query="INSERT INTO $table (title, date) VALUES ('now', NOW())";
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
#RewriteCond %{REQUEST_URI} !/test\.php
RewriteRule .* test.php
Answer the question
In order to leave comments, you need to log in
The main points when compiling mod_rewrite rules are well chewed in the article https://habr.com/company/sprinthost/blog/129560/
Many modern browsers do not require an explicit indication <link rel="icon" href="/someimage.ico" />
and try to find the icon in the root of the site themselves.
RewriteCond %{REQUEST_URI} !/test\.php
RewriteRule .* test.php
/favicon.ico
test.php will be called. $log = date('H:i:s ') . $_SERVER['REQUEST_URI'] . PHP_EOL;
file_put_contents('log.txt', $log, FILE_APPEND);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question