Problems, need help? Have a tip or advice? Post it here.
13 posts Page 1 of 2
I have included a mailto link within some text on a couch page. The link is coded directly in the HTML and not in the couch database, if that's relevant. Here it is:

<p><a href="mailto:someone@somewhere.com">Contact me</a></p>

Rolling over or clicking on the link, however, produces this:

http://www.mysite.com/page/"mailto:someone@somewhere.com"
(including the quotation marks even)

I tried using the base url trick in the header but no joy.

I'm using pretty urls, if that's relevant.

Does anyone have some idea how I can make this basic link work as it's supposed to? I am quite sure I am probably doing something wrong, but I can't understand what.
Did you by accident added a <base> html tag to <head>?
Thanks, Trendoman.

The MAILTO problem existed before I added a <base> element to <head>, so I then added a <base> element in order to see if that would truncate the href link. Unfortunately, the problem remains unchanged with or without the <base> element.

For what it's worth, these are the <base> tags I tried, none of which fixed the problem:

<head>
<base href="" /> [this changes literally nothing]

[These ones remove the folder name in the url, but they keep the basic site url]

<base href="/" />
<base href="https://www.mysite.com/" />
<base href="https://www.mysite.com" /> (without the ending slash)

</head>
Couch does not add anything to the markup (unless, of course, explicitly asked to by using cms: tags).
There has to be some other factor at play here.

Are you, by any chance, using some none-core addon? Please check your couch/addons/kfunctions.php file.
That is helpful info.

No, I haven't added any add-ons of any kind, but I will look and make sure, and I'll also look around for possible weirdness in my page coding.

Thanks, KK.
OK. No addons and there is nothing weird in the page itself.

I'm starting to convince myself that this MAILTO link issue is the result of my PRETTY URLS HTACCESS file. I'm pretty sure that the mailto link in this page is being rewritten by the htaccess code for the page.

Interestingly, I have another mailto link in the footer that works fine. (This footer is a separate, non-Couch file brought in by a PHP include).

I wonder if there's a way to exempt that mailto link in the PRETTY URLS HTACCESS file.
I CAN NOW RE-STATE MY ISSUE MORE CONCISELY:

1. Every couch page I have, if I'm using pretty urls, sets the base url for all relative links on that page to THAT PARTICULAR PAGE, instead of to the WEB ROOT. But I can fix this issue by putting a slash in front of the relative url.

2. But MAILTO links are different. I can't put a slash in front of these; they continue to resolve to the site and page URL plus the "mailto" href (including the quotation marks.

And using a <base> url tag in the header still puts the base domain name in front of the mailto href and still keeps the quotation marks which shouldn't appear.

This is not a question, just a restatement of my issue.

Thanks again for your assistance, KK and Trendoman.
I can help you review htaccess. Check if setting for RewriteBase / is correct in htaccess file and also try to explicitly define K_SITE_URL in couch config.
Thanks, Trendoman.

1. RewriteBase / is correctly set and uncommented.

2. The issues I'm having remain both with and without K_SITE_URL set.

3. My HTACCESS file includes some stuff up at the top that has nothing to do with pretty urls. One prevents public directory access and one currently sets and enforces a password on the site. But here is one more, in case it affects anything. It's for enforcing SSL connections, I believe:

Code: Select all
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

(The auto-generated pretty urls code follows below that.)
Code: Select all
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

This code "remembers" everything in request and puts it after https://www.mysite.com/, effectively duplicating the link. No matter what you will do in page's code this line messes things up. It is wrong and must be replaced.
13 posts Page 1 of 2