Ok, so I rewrote the URL on my website, now for some reason it throws a 404 error if I type www.domain.com, if I type domian.com, everything works fine.
DirectoryIndex home.php IndexIgnore *
Note. I commented on the first 2 rewrite rules, even if I changed them, it does not affect after loading .htaccess to the server, it looks like it is cached.
For more information, I use the <base> , which is located in embeds.php
if($_SERVER['REMOTE_ADDR'] == '::1') { echo '<base href="http://localhost/projects/directory/" />'; } else { echo '<base href="http://domain.com/directory/" />'; }
Directory structure
Root - home.php about.php -stylesheets default.css -includes embeds.php 404.php .htaccess
embeds.php included in home.php , about.php , etc., and style sheets, scripts, etc., insert the header along with the <base> in embeds.php
source share