You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is my headache of the day : Using ui-router 0.2.15, angular 1.3.17, HTML5Mode is activated, Apache .htaccess relevant part is :
<ifModule mod_rewrite.c>
RewriteEngine On
# REDIRECT HTTP TO HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.my-website.com/$1 [R,L]
# REDIRECT ALL NON-WWW TO WWW
RewriteCond %{HTTP_HOST} ^my-website.com
RewriteRule (.*) https://www.my-website.com/$1 [R=301,L]
# FOR ANGULAR -> redirect everything to index.html except directories api & assets & admin
RewriteRule ^(api|assets|admin)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
I can navigate between different states using :
$state.go(my_state,{'#':my_hash});
hash is correctly appended to url and with this HTML :
<divui-viewautoscroll="true"></div>
and javascript config block :
$uiViewScrollProvider.useAnchorScroll();
run block
$anchorScroll.yOffset=80;/* because of a fixed bootstrap navbar, I need an offset */
the router automatically scrolls to my element with id="my_hash"
So everything would be perfect IF I could access my states when doing a page refresh or a direct access to an URL like :
https://www.my_website.com/my_state_url_path#my_hash
when I do so, everything which is after # is removed from the URL. I'm pretty sure it doesn't come from .htaccess.
Is there any declaration to do in state definition to make it works ? Does it works out of the box for you ? Thanks for any suggestions !
Hugo
EDIT
It is now sure it comes from my router's config because doing a simple :
https://www.my_website.com#hello
keeps the "hello" so I have to precise I'm using nested states and now believe hash is lost between state transition ... and seems to be linked to #510
The text was updated successfully, but these errors were encountered:
Hi everybody !
Here is my headache of the day : Using ui-router 0.2.15, angular 1.3.17, HTML5Mode is activated, Apache .htaccess relevant part is :
I can navigate between different states using :
hash is correctly appended to url and with this HTML :
and javascript config block :
run block
the router automatically scrolls to my element with id="my_hash"
So everything would be perfect IF I could access my states when doing a page refresh or a direct access to an URL like :
https://www.my_website.com/my_state_url_path#my_hash
when I do so, everything which is after # is removed from the URL. I'm pretty sure it doesn't come from .htaccess.
Is there any declaration to do in state definition to make it works ? Does it works out of the box for you ? Thanks for any suggestions !
Hugo
EDIT
It is now sure it comes from my router's config because doing a simple :
https://www.my_website.com#hello
keeps the "hello" so I have to precise I'm using nested states and now believe hash is lost between state transition ... and seems to be linked to #510
The text was updated successfully, but these errors were encountered: