Dotclear

Vous n'êtes pas identifié(e).

Annonce

13 février 2024 Sortie de Dotclear 2.29

#1 2016-03-09 17:18:28

COS45
Membre
Inscription : 2016-03-09

URL rewrite problem creating 404 error

Hi I'm trying to add hyperlinks to a post, but what I find once published is that they get rewritten to include the actual domain name beforehand- so the live site produces 404 errors.
So I input www.link.tld and the published post turns the link into www.mysite.tld/www.link.tld

With gratitude

Hors ligne

#2 2016-03-09 17:36:06

pierrevg
Membre
Inscription : 2005-04-13
Site Web

Re : URL rewrite problem creating 404 error

Bonjour aussi

Et en mettant devant le protocole, soit :
http://
?

Hors ligne

#3 2016-03-09 18:01:07

COS45
Membre
Inscription : 2016-03-09

Re : URL rewrite problem creating 404 error

If I understand correctly... Yes I was using the full url e.g. http://www.link.tld but on rechecking it loses the protocol.
I.E. http://imgur.com/a/2gava

.htaccess has this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

index.php has this:

 
if (isset($_SERVER['DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['DC_BLOG_ID']);
} elseif (isset($_SERVER['REDIRECT_DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['REDIRECT_DC_BLOG_ID']);
}else {
	# Define your blog here
	define('DC_BLOG_ID','default');
}

require dirname(__FILE__).'/inc/public/prepend.php';

Does that help to help me?

Dernière modification par COS45 (2016-03-09 23:08:33)

Hors ligne

#4 2016-03-09 23:50:33

COS45
Membre
Inscription : 2016-03-09

Re : URL rewrite problem creating 404 error

I certainly need some guidance on this. I don't really know where to start. If I can get a nudge in the right direction, it would be a great help.
Many thanks.

Hors ligne

#5 2016-03-10 04:46:58

ben_griffith
Membre
Lieu : Wiltshire
Inscription : 2009-09-28

Re : URL rewrite problem creating 404 error

Hi COS45

There is no problem with Dotclear and the way how it behaves is correct.

As you noticed in http://imgur.com/a/2gava,
- writing www.test.com leads to a (non existing) address inside your blog.
- Writing http://www.test.com leads to an address outside your blog.

A hyperlink link always contains "http://" (if it's not about a ftp address)

That modern browsers don't show "http://" in the address line is not Dotclear's fault but a changed browser behaviour to deal with address lines that started maybe 10 years ago. Meanwhile, most people access a "http://" and not a "ftp" protocol.
If you would have used a browser 15 years ago, you would have had the same error if you typed only "www...com".

Entering a hyperlink into your blog is not the same as entering a hyperlink into the address line of a browser. You need to define what you want to access. Because you are not the only user, Dotclear needs to keep that line clean. In case somebody wants to link to a FTP protocol, he would be in trouble if Dotclear automatically leads to a HTTP protocol.

Summary: You already know what to do. Type "http://" and your links work.

Dernière modification par ben_griffith (2016-03-10 05:07:36)


I Dotclear.

Hors ligne

#6 2016-03-10 09:58:40

COS45
Membre
Inscription : 2016-03-09

Re : URL rewrite problem creating 404 error

Hi Ben,
Thanks for your reply.
I don't think i've explained myself very clearly, sorry about that.  I do know that what you say is correct about the protocol. I'm not claiming there is something wrong with dotclear. I think that perhaps I have a config issue or I have something turned off that should be on or viceversa in php configurations?
The problem manifests on my web page once i've made the post and it appears as follows:
When I click on a link, only on my dotclear site, the hyperlink somehow has the site web address added in before the external link I want to go to. So that what should be http://www.link.tld becomes http://www.mysite.tld/http://www.link.tld which obviously then tries to find http://www.link.tld as a web page on my domain  - hence the 404 error.

I posted the http://imgur.com/a/2gava because I do input the http:// and then click insert, but the above still happens. If I go back to the link the http:// is missing from the input field - that's what I meant to demonstrate with the images.

So what I am at a loss to figure out is what is causing this. I'm sure that others must have had a similar niggle because their php config or something in their set up didn't have a needed function on or needed to amend a line or section, comment a part out or allow it.

Dernière modification par COS45 (2016-03-10 10:00:15)

Hors ligne

#7 2016-03-10 11:53:33

COS45
Membre
Inscription : 2016-03-09

Re : URL rewrite problem creating 404 error

Hello again,
This was resolved- there was a mod_ rewrite issue  and a problem with the ck editor.

Hors ligne

#8 2016-03-10 17:14:42

ben_griffith
Membre
Lieu : Wiltshire
Inscription : 2009-09-28

Re : URL rewrite problem creating 404 error

@COS45

Great that you solved it.

I was just going to write to you that it's probably the gap between dot and / in RewriteRule . /index.php [L] that causes the issue.
I use "RewriteRule ./index.php [L]"


I Dotclear.

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map