Issue
I'm running an AJAX enabled site that caters for HTML4 hash and HTML5 pushstate().
I've just migrated to an AWS EC2 instance (linux server running apache) and both site are running fine.
The only issue I've experienced is when I refresh a HTML4 hash page the correct page shows.
However when I refresh a HTML5 page like http://www.datingjapan.co/conversations I get the following error message:
It appears that apache is trying to go into the folder 'converstations' rather then just call the site 'index.php' which then using jquery to load the correct page.
Can anyone advise what might be the issue here. I'm assuming its a httpd.conf settings.
thx
Solution
If you're trying to use an index.php
file as some type of bootstrap you might want to try this in your .htaccess
file:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.).+$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Basically this will redirect all request from non-www to www and then if its not a file or a directory it will forward the request to the index.php
file.
Answered By - PhearOfRayne Answer Checked By - Terry (WPSolving Volunteer)