I have a custom top navigation bar at the top of my Intranet and it loads menu options based on what you put in the menu_data.js file. The problem is SharePoint (A MS Portal App) which has 3 links for site settings and on the standard microsoft navbar, it knows if the is
http://sharepoint/sites/maketing or
http://sharepoint/sites/marketing/projects or even
http://sharepoint/sites/sales (the file name is something .aspx) so if I could find *.aspx and replace it with the current url the user is at....that would be great! I was using the below code and it worked great until I realized that not all pages are called default.aspx
<html>
<head>
<script>
var link = location.href
var regEx = new RegExp ('default.aspx', 'gi') ;
link = link.replace(regEx, '_layouts/1033/settings.aspx')
document.write(link)
</script>
</head>
</html>