开发者

Hash mark removes pretty url part

I'm trying to figure something out, but can't seem to find the reason why, and I'm rather confident it's something stupid, so I'm posting 开发者_运维技巧it here to get a bit of help.

I'm using URL rewriting to redirect URL's to the correct page. The only rule I actually have is:

RewriteBase /~bart/website
RewriteRule ^([a-zA-Z0-9_/\-\+|]+)$ index.php?m=$1 [L,QSA]

Which redirects pretty much everything to index, which is fine, as that is how the system works.

Now I call this url:

http://localhost/~bart/website/admin/list_content/edit/activiteit/1

This one works pretty well, but then comes the problem.

The page that is returned contains a jQuery UI tabber with 3 tabs. The tab headers consist of links like <a href="#tab1">Tab1</a> which is the standard format for jquery UI tabs that do nothing fancy. The only problem is that clicking those leads to:

http://localhost/~bart/website/#tab1

This is a different page in the eyes of my browser and as such it load the new page (my main page) instead of a new tab on the old page.

I can't for the life of me figure out what the reason it, and any help would be greatly appreciated.


This is a wild guess, but maybe you have a <base href="http://localhost/~bart/website/" /> in your HTML? This could confuse the browser.


If you have a HTML tag (for the relative urls of css and scripts), then your relative urls are relative to the url of tag instead of the current page url.

Use the absolute URL in the href.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜