Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
edited by

Previously, my website was functioning correctly, but now I am unable to access URLs with whitespace in the tags or usernames. It appears that the Q2A script is not replacing whitespace with a plus sign (+) in the tag URLs, causing a 'Forbidden' error when trying to access those pages. How can I fix this issue?

I found that htaccess option in url structure is not OK but I doubt how it automatically changed from OK to blank and I have not even changed anything on server side.

Mod rewrite options is already enabled and htaccess file is also already available with default settings.

But still first URL structure is not OK and I have the problem accessing the URL mentioned above.

Please anyone help me fix the issue.

Q2A version: 1.8.6
Actually the issue is this many sites are getting affected due to this, please look into it

Hi @pupi1985, I found the reason causing the issue, the issue occurred due to your patch which I followed and changes to my code.

Here is the url of your patch:
Actually you suggested to replace urlencode() function with rawurlencode() and rawurlencode() function is not replacing white space between tag names with plus sign(+).

While urlencode() was replacing space with plus sign which was working as expected.

When I rollback your patch my issue got resolved.
Strictly speaking, you never answered my request, which was "a link to a live site showing this issue to see the actual URL being generated". This is a must for me to continue with any analysis.

Answering your comment about the urlencode/rawurlencode concern, in short, urlencode is non-standard and there is no reason to use it nowadays.

Using rawurlencode does not leave a space, as you implied, but rather replaces it with a %20. If that is not happening, then there is another issue, which is unrelated to this (most likely, a plugin or a corehack intefering with the URL generation).

So if you can show me the live page, I will confirm if this is the case or not.

Please log in or register to answer this question.