I've been looking for a way to force browsers to add my custom address when using links without full domain. Lets say i have a link: link (please see source, i didnt specify domain) Is there any way to tell browser that my link should lead to stackoverflow.com/en/link instead of stackoverflow.com/link? Ty in advance.
Asked
Active
Viewed 331 times
0
-
Are you talking about htaccess? If you don't know what it means, google it. – Ranveer Feb 06 '14 at 09:16
-
Do you mean something like the base HTML tag? – Krisztián Balla Feb 06 '14 at 09:17
-
Or something like the MVC framework? – Ranveer Feb 06 '14 at 09:17
-
@Ranveer no, I dont talk about htaccess. Read my question again. See source of my link (href="/link") see? No domain specified, i would like it to point to stackoverflow.com/en/link, but i cant use htaccess as i have something else at stackoverflow.com/link. Kinda messy but you should get it. – onedayiwillchangethis Feb 06 '14 at 09:18
-
Sorry I didn't get your question correctly. – Ranveer Feb 06 '14 at 09:19
-
@JennyO'Reilly ye something like base tag but it wont work for my problem. Base tag is only for relative urls and this is not the case :( – onedayiwillchangethis Feb 06 '14 at 09:20
-
I am not aware of any other solutions that works on the client side (browser). Maybe JavaScript? What is the puspose of this? Maybe there is a different approach. – Krisztián Balla Feb 06 '14 at 09:27
-
I've developed custom multisite cms, client wants another site but he doesnt want subdomain but just /en url after current one, lol. Nevermind then, ill just change the way links are created then. Thanks for your time – onedayiwillchangethis Feb 06 '14 at 09:44
1 Answers
1
<base href="http://www.example.com/en/">

feeela
- 29,399
- 7
- 59
- 71
-
1Maybe also read this: http://stackoverflow.com/questions/1889076/is-it-recommended-to-use-the-base-html-tag – Krisztián Balla Feb 06 '14 at 09:19
-
It would work if i used href="link", but not for "/link". Thats my problem – onedayiwillchangethis Feb 06 '14 at 09:22