我运行一个AJAX启用的网站,迎合了HTML4散列和HTML5 pushstate()。
I'm running an AJAX enabled site that caters for HTML4 hash and HTML5 pushstate().
我刚刚迁移到AWS EC2实例(Linux服务器上运行的Apache)和两个网站都运行正常。
I've just migrated to an AWS EC2 instance (linux server running apache) and both site are running fine.
我所遇到的唯一问题是,当我刷新HTML4散列页正确的页面显示。
The only issue I've experienced is when I refresh a HTML4 hash page the correct page shows.
然而,当我刷新如 www.datingjapan.co/conversations 一个HTML5页面我收到以下错误信息:
However when I refresh a HTML5 page like www.datingjapan.co/conversations I get the following error message:
看来,Apache是试图进入该文件夹converstations而就可以致电该网站的index.php',然后使用jQuery来加载正确的页面。
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.
任何人都可以建议可能是什么问题在这里。我假设它的一个httpd.conf中设置。
Can anyone advise what might be the issue here. I'm assuming its a httpd.conf settings.
THX
推荐答案如果你想使用的index.php 文件作为某种类型的引导,你可能想试试这个在您的的.htaccess 文件:
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 ^(.*)$ www.%1/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule>
基本上,这将非www的所有请求重定向到www,然后如果它不是一个文件或目录,将请求转发到的index.php 文件。
更多推荐
httpd.conf文件和HTML5 pushstate()
发布评论