Quantcast
  • Register
PhysicsOverflow is a next-generation academic platform for physicists and astronomers, including a community peer review system and a postgraduate-level discussion forum analogous to MathOverflow.

Welcome to PhysicsOverflow! PhysicsOverflow is an open platform for community peer review and graduate-level Physics discussion.

Please help promote PhysicsOverflow ads elsewhere if you like it.

News

PO is now at the Physics Department of Bielefeld University!

New printer friendly PO pages!

Migration to Bielefeld University was successful!

Please vote for this year's PhysicsOverflow ads!

Please do help out in categorising submissions. Submit a paper to PhysicsOverflow!

... see more

Tools for paper authors

Submit paper
Claim Paper Authorship

Tools for SE users

Search User
Reclaim SE Account
Request Account Merger
Nativise imported posts
Claim post (deleted users)
Import SE post

Users whose questions have been imported from Physics Stack Exchange, Theoretical Physics Stack Exchange, or any other Stack Exchange site are kindly requested to reclaim their account and not to register as a new user.

Public \(\beta\) tools

Report a bug with a feature
Request a new functionality
404 page design
Send feedback

Attributions

(propose a free ad)

Site Statistics

205 submissions , 163 unreviewed
5,082 questions , 2,232 unanswered
5,353 answers , 22,789 comments
1,470 users with positive rep
820 active unimported users
More ...

  On Relative Links and a Simplified URL structure

+ 0 like - 0 dislike
1308 views

I realised a few days back, that while using the most simplified URL structure, /123/why-do-birds-sing, relative links don't work! The simplest URL structure for which it works is /?qa=123/why-do-birds-sing, Here is the exact description of the problem that I sent to polarkernel just today. 

[...] This is because, in the /123/why-do-birds-sing format, if I am on say, /4636/technical-feature-requests, if I click on say, the attributions link, instead of being directed to /attributions-page, I am directed to /4636/attributions-page instead of /attributions-page.   
 
Or if I click on a link to say, /4606/can-we-install-comment-rating, then I am instead directed to /4636/4606/can-we-install-comment-rating. [...]  

One solution is that just before we go online, public, we make all the relative links absolute.    

However, this would be very time consuming. Is there a way to probably edit the htaccess file itself, so that the relative links are still correct?  

I have turned the simplest URL structure on for a while just so that you understand what I mean. Here are a few links: 

attributions-page

./attributions-page

/attributions-page

4606

./4606

/4606

asked Mar 16, 2014 in Feature Request by dimension10 (1,985 points) [ no revision ]
retagged Mar 16, 2014 by dimension10

1 Answer

+ 2 like - 0 dislike

This is a cautionary tale on the fact, that on a system which is that complex, changes should only be made if well understood and tested.

If we look at the source code of a page using this /123/why-do-birds-sing URL structure, we see that all relative links created by Q2A are now written as ../link, using a double-dot slash.

In order to rescue this situation, I have made a patch (fortunately possible within my OverSnow theme) that corrects all relative links in questions, answers and comments, so that the following types of links work correctly:

/attributions-page
./attributions-page
../attributions-page

/4657
./4657
../4657

This should repair almost everything. Links made by hand by us administrators, like those in the upper side-panel, have to be absolute. We will have to think on that if we move to go online.

answered Mar 16, 2014 by polarkernel (0 points) [ no revision ]

Thanks! That greatly simplifies the work needed to do, and definitely saves the situation : )   

Your answer

Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead.
To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL.
Please consult the FAQ for as to how to format your post.
This is the answer box; if you want to write a comment instead, please use the 'add comment' button.
Live preview (may slow down editor)   Preview
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:
p$\hbar$ysicsOve$\varnothing$flow
Then drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds).
Please complete the anti-spam verification




user contributions licensed under cc by-sa 3.0 with attribution required

Your rights
...