1

I recently uploaded a PHP theme on my server. It's working fine on any other sections except my home page. For example, when accessing www.mywebsite.com/anything the theme is working but when on homepage www.mywebsite.com the server's default page is shown.

I was playing with the htacess RewriteEngine and it was working in some cases but probably not correct. This is what I have so far:

<IfModule mod_rewrite.c>
RewriteEngine on
Options -Multiviews
RewriteCond %{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^(.*)?$ index.php?a=$1  [QSA,NC,L]
ErrorDocument 404 /new/404.php
</IfModule>

This is making my home page work, but the title is not showing it's saying "Page Not Found" on the title. The page is working and all I'm changing is the two RewriteCond above. They were set to {REQUEST_FILENAME} but that made my website homepage not work and show the default server page.

pat o.
  • 1,919
  • 1
  • 16
  • 28
Nedi
  • 11
  • 2

1 Answers1

0

It isn't clear in your question if the correct PHP files are being hit. Assuming the syntax of your .htaccess is correct:

Your RewriteRule is indicating your index.php as the receiver for any files and directories that do not exist, with the path (I believe) being sent to $_GET['a']... it is up to your index.php to detect and handle this appropriately.

ErrorDocument is a separate mechanism and once again, if the 404.php is being hit it is up to it to e.g. header('HTTP/1.1 404 File Not Found') and then output HTML that indicates a page not found.

Keilaron
  • 111
  • 2
  • this is what i have found in my index.php run(); ?> – Nedi Apr 05 '16 at 21:21
  • So this is an application someone else wrote? Which application is it? Is there any documentation on how to accomplish this redirect? – Keilaron Apr 06 '16 at 17:40