Something is going wrong with url's - bolt-cms

In my header and footer template I have links like /pagina/test.
This works, but on other pages Bolt generates links like pagina/pagina/test. What am I doing wrong here?
To prevent wrong links I type in the whole url now www.test.nl/pagina/test, but this is not an ideal situation.

Normally I 'd say that you'd forgotten the first slash, but since you've specifically stated that you put that one in...
Could you post a more complete chunk of code?

Related

Mediawiki get Content from one page to another

I searched way too long to find an answer to this problem, but I keep finding the wrong things.
My problem is I need to extract content from page A by writing code on page B.
So, for example, I have Page A with the content:
here is some text
and on page B my code is something like:
getcontent(Page A)
and it shows:
here is some text
Obviously I will work with that output, but for now, I just need to transfer the content.
Thanks in advance
The answer was provided by Tgr in comments and it was Title:getContent().
You can transclude a page with the same syntax as a template call, just put a : before the page title (that represents "main namespace"):
in page B:
{{:Page A}}

HTML anchor and query string

Is it possible to do something like the URL below?
myurl.co.uk/#myAnchor?myQry=this
I'm trying to pass tracking codes while also being able to have multiple links from an email go to relevant parts of my page.
This currently seems to do nothing as it is. Is it actually possible.
The query goes before the anchor, so:
http://example.com/page.php?parameter=value#anchor
Though the query always comes before any anchors, here is the solution for this if required.
One solution for this could be to use Apache HTACCESS and declare #myAnchor in rewrite rules. Then you can use something like this:
myurl.co.uk/#myAnchor?myQry=this
But please remember that in the htaccess the # is also used for commenting so you will have to escape it with a rewrite rule.

URL#whatever issue with length of #tag

Here's a question i'm finding hard to answer with google and seem to be having problems with it on my site.
I am encoding/decoding user id's just to confuse matters and would like to link to parts of a page using anchors
Thing is.. My encryption is making a nice secure long string but I think there must be a limit to the length of the # anchor names because it works when its shorter, but not when its longer.
Does this seem to be true?
An example of the hash tag url is http://wgwegw.co.uk/wegweg/protected/view-game/wegweg/platform#x243j3f41684w2w2m594n416
For example i have a link:
Go to comment
When i click on it.. it opens up using HTACCESS file redirects. if i use javascript window.hash it returns the hash so i imagine the hash code is not affected by the htaccess redirects.
I land on the page: http://.co.uk//protected/view-game/*/platform#y213j3f41684w2w2m594n416
On that page in html is an anchor name: <a name="y213j3f41684w2w2m594n416"></a>
It does not skip to that part of the page?
OK here you go.
You won't believe this but I have suffixed an 'a' and now it works.
What on earth?
EDITED//
Could it be because i have an id and a name that equal the same? so i have a
<div id = "y213j3f41684w2w2m594n416">
and I have a
<a name = "y213j3f41684w2w2m594n416" />
So when i attach a to the end of the name.. it no longer is the same as the id and thus doesn't get confused?
EDITED//
If I try this on W3 example tweaks it still works so it can't be that?
Aghh now it's fixed i am desperate to know why it's working.

Regex to find http and .html

I'm trying to find links in the following format:
http://subdomain.subdomain.domain.tld/subfolder/randomstring.html
Basically, I need a regex that looks for http:// and stops looking when it finds .html. Everything in between shouldn't matter. I.e., more/less subdomains, variable TLD and variable folder.
Is this possible?
((http://)?=(.html))
What I've got so far (not functional) is this. I'm really not familiar with the look-ahead assertion so I might be on the wrong track.
Anyways, any help is going to be greatly appreciated!
Look ahead? You only need a non-greedy match everything.
/http:\/\/.*?\.html/
I would use something like: /http:\/\/[^<>\s]+?\.html/
Can be enhanced, but at least won't match stuff like:
http://something.com/ has a lot of .html files

How can I convert URLs in text to HTML links?

I'm writing a forum-type discussion board in Perl and would like to change automatically http://www.google.com to be an HTML link. This should also be safe, and err on the side of security. Is there a quick, easy, and safe way to add links automatically?
Try something like this:
use Regexp::Common qw /URI/;
$text =~ s|($RE{URI}{HTTP})(?!</a>)|$1|g
The key here is using Regexp::Common::URI which probably has a more thorough url matcher than anything I could come up with. Also I do a negative lookahead assertion at the end to make sure that the url is not already in a link. That last part isn't exactly thorough, since it's possible that somebody could do something like this:
http://www.mysite.com is my website
To do this correctly you'd need to parse the entire submission text and only substitute out urls that are not already part of a link.