w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Non existent pages to error page htaccess

This is the rule that is causing it:

#hide de logged-in.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ logged-in.php?$1 [L,QSA]

But it looks like it's something that you want. This rule essentially says "if the request is for a non-existent file or directory" rewrite it to logged-in.php. The rule that follows that takes requests for logged-in.php and redirects the browser to remove the "logged-in.php" bit of the URL.

If you want to remove it, just change your htaccess file to:

RewriteEngine On
RewriteBase /

#Hide de submap pages
RewriteRule ^$ pages/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{DOCUMENT_ROOT}/pages%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/pages%{REQUEST_URI} -d
RewriteRule ^(.*)$ pages/$1 [L]

ErrorDocument 400     /400.html
ErrorDocument 401     /401.html
ErrorDocument 403     /403.html
ErrorDocument 404     /404.html

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.