Answer the question
In order to leave comments, you need to log in
Why does typing SERVER['REQUEST_URI'] result in a 404 error?
The Apache web server is installed on the local machine. There are two domains: localhost and sub.localhost
When navigating through these domain names, everything works fine, index.php opens from /var/www/html/ .
All I have to do is type crm.localhost/something and it results in a 404 error. What's the problem?
.htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./index.php
<?php
$sub = explode('.', urldecode($_SERVER['HTTP_HOST']))[0];
if ($sub == 'sub') {
include 'template/subdomain.php';
} else {
include 'template/domain.php';
}
?>
Answer the question
In order to leave comments, you need to log in
strange, but the title is about SERVER['REQUEST_URI'] - but the question is about something else.
In your case, most likely the Apache config is not correctly configured, and the folders in the config itself are not correctly forwarded, can you show the Apache config?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question