html5mode(true) & htaccess

90 views
Skip to first unread message

gkielwasser

unread,
Jul 9, 2013, 8:46:29 AM7/9/13
to ang...@googlegroups.com
Hello,

I'm trying to turn on the html5mode with the hashbang "!". 

When i go to the url www.ottercamp.com/#!/events/987987, the url becomes  www.ottercamp.com/events/987987 so everything is fine. When i navigate inside my application , url are fine too.

However, I have a problem when I refresh a page like this one : www.ottercamp.com/events/987987, my server doesn't know this page so it returns a 404.

I'm trying to redirect all requests to the server to my main-page which is www.ottercamp.com/index.php excepts for some requests. To achieve it, i made a .htaccess file.

<IfModule mod_rewrite.c>

RewriteEngine On
Options +FollowSymLinks
 
# ----------------------------------------------------------------------
#  General Rule
# ----------------------------------------------------------------------
 
# Redirect to main page
RewriteRule ^index.php(.*)$ - [L,QSA]

# ----------------------------------------------------------------------
#  Exception to the general rule 
# ----------------------------------------------------------------------

# Ignore
RewriteRule assets/(.*)$ index.php/$1 [L,QSA]
RewriteRule forecast/(.*)$ index.php/$1 [L,QSA]
RewriteRule login/(.*)$ index.php/$1 [L,QSA]
RewriteRule logout/(.*)$ index.php/$1 [L,QSA]
RewriteRule about/(.*)$ index.php/$1 [L,QSA]
RewriteRule register/(.*)$ index.php/$1 [L,QSA]

</IfModule>

The application works fine with this htaccess. However, if I refresh a page like  www.ottercamp.com/events/987987Apache returns "The requested URL /ottercamp/events/51d55e69e4b012d16b42d737 was not found on this server."

Does it means I have to do some more things in the server to turn the html5mode on my application? Actually, I have just one page in the server which is index.php.

Thanks for help and any explanations!

Polokh Andrey

unread,
Mar 6, 2015, 4:35:59 AM3/6/15
to ang...@googlegroups.com
Hello, 

Just have the same issue. Did you find out how to solve this? 

Thanks
Reply all
Reply to author
Forward
0 new messages