Hello/Hi/Greetings,
I've managed to edit the .htaccess for my site and have successfully hidden the index.php from my site's address, but I can't for the life of get rid of a nuisance question mark in the middle of my directory addresses like this:
https://www.mytoysteam.co.uk/?/categories
to
https://www.mytoysteam.co.uk/categories
Adding the line does not work in the local file editor, nor do any of the other solutions I have found across the internet.
Here is my .htaccess:
#TURN ON REWRITES
RewriteEngine on
RewriteBase /
#THEN OPTIONALLY MAKE IT www if they didnt enter it
RewriteCond %{HTTP_HOST} !^(www\.)?mytoysteam\.co.uk$ [NC]
RewriteRule ^(.*) https://www.mytoysteam.co.uk/$1 [R=301,L]
#Write index.any to /
RewriteRule ^index\.[a-z]{2,3} / [L,R=301]
#THEN REWRITE LOCATIONS
RewriteRule ^([0-9]+)/category/(.*)$ picture.php?id=$1&page_url=$2 [L]
#IF CATEGORY IS ALSO DYNAMIC THEN TRY THIS FOR REWRITE
RewriteRule ^([0-9]+)/(.*)/(.*)$ picture.php?id=$1&category=$2&page_url=$3 [L]
Environment
Piwigo 11.0.0 Check for upgrade
Operating system: Linux
PHP: 7.3.26 (Show info) [2021-01-31 19:25:10]
MySQL: 5.7.33 [2021-01-31 19:25:10]
Graphics Library: ImageMagick 6.9.10-68
Piwigo URL: https://www.mytoysteam.co.uk/
Offline
from the include config file:
// question_mark_in_urls : the generated urls contain a ? sign. This can be
// changed to false only if the server translates PATH_INFO variable
// (depends on the server AcceptPathInfo directive configuration)
$conf['question_mark_in_urls'] = false;
Offline
executive wrote:
from the include config file:
// question_mark_in_urls : the generated urls contain a ? sign. This can be
// changed to false only if the server translates PATH_INFO variable
// (depends on the server AcceptPathInfo directive configuration)
$conf['question_mark_in_urls'] = false;
I did specifically say that doesn't work anymore once you edit the .htaccess file as above even with AcceptPathInfo. This is why I'm asking if there's a solution within .htaccess that works.
Last edited by simonjonnemeth (2021-01-31 22:28:02)
Offline
simonjonnemeth wrote:
I did specifically say that doesn't work anymore once you edit the .htaccess file as above even with AcceptPathInfo.
No, you did not say that. You didn't mention question_mark_in_urls so how are we supposed to know what you tried or did not try?
Offline
erAck wrote:
simonjonnemeth wrote:
I did specifically say that doesn't work anymore once you edit the .htaccess file as above even with AcceptPathInfo.
No, you did not say that. You didn't mention question_mark_in_urls so how are we supposed to know what you tried or did not try?
"Adding the line does not work in the local file editor, nor do any of the other solutions I have found across the internet."
Offline
Adding “AcceptPathInfo On” to your .htaccess doesn’t allow you to set question_mark_in_urls to false?
Offline
And the wording "adding the line" without mentioning which or what you found across the internet is supposed to tell us what exactly you tried?
Anyway, AFAIK you can't get rid of both, the index path part and the question mark, at the same time. Live with only the index part by using
$conf['php_extension_in_urls'] = false;
$conf['question_mark_in_urls'] = false;
and then it's unnecessary to do any RewriteRule in .htaccess.
Offline
erAck wrote:
And the wording "adding the line" without mentioning which or what you found across the internet is supposed to tell us what exactly you tried?
Anyway, AFAIK you can't get rid of both, the index path part and the question mark, at the same time. Live with only the index part by using
$conf['php_extension_in_urls'] = false;
$conf['question_mark_in_urls'] = false;
and then it's unnecessary to do any RewriteRule in .htaccess.
If you aren't going to tell me anything that hasn't been said across the forums numerous times already then don't bother. If all your happy doing is criticizing, again don't bother, and what other line is there for removing the question mark? It only takes common sense to know what I'm talking about there, especially since it's clearly aimed at people with more knowledge than I have.
Offline
sorry, my mind reading skills aren't what they used to be
simonjonnemeth wrote:
If all your happy doing is criticizing, again don't bother
good advice
Offline
I thought he was trying his best to be helpful ¯\_(ツ)_/¯
Offline
executive wrote:
sorry, my mind reading skills aren't what they used to be
simonjonnemeth wrote:
If all your happy doing is criticizing, again don't bother
good advice
Seriously, what other line would I possibly add that involves removing question marks from URLs?
Last edited by simonjonnemeth (2021-02-01 02:16:11)
Offline
I don't know. I must be too stupid. I'm so sorry the support here isn't up to your standards. Would you like a refund?
Offline
I think erack already answered the question
Offline
simonjonnemeth wrote:
If you aren't going to tell me anything that hasn't been said across the forums numerous times already then don't bother. If all your happy doing is criticizing, again don't bother
If you don't appreciate the attempts to make sense of your words then feel welcome to make yourself comfortable on my ignore list. I won't bother you again.
Offline
Hello-Bonjour !
I will keep to the original question, if you please, gentlemen : how to beautify my url ?
- I never had any problem with getting rid of index.php on home page, since it was never displayed.
- I was able to suppress the question mark via Local File Editor with one of my hosting provider
- I was able to hide the php extension via Local File Editor with my other hosting provider
- But not the other way round
- And nowhere both (? and .php) at the same time
Everything with Piwigo 2.10.2. And I never tampered in anyway with my htaccess.
If I want to know why I cannot hide ? or php at such or such host, what would you need to know ?
Online