Announcement

#1 2021-01-31 20:26:11

simonjonnemeth
Member
2021-01-06
11

Question mark in address after hiding index.php

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

 

#2 2021-01-31 21:45:10

executive
Member
2017-08-16
1214

Re: Question mark in address after hiding index.php

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

 

#3 2021-01-31 22:24:03

simonjonnemeth
Member
2021-01-06
11

Re: Question mark in address after hiding index.php

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

 

#4 2021-01-31 23:26:06

erAck
Only trying to help
2015-09-06
2031

Re: Question mark in address after hiding index.php

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?


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2021-01-31 23:39:21

simonjonnemeth
Member
2021-01-06
11

Re: Question mark in address after hiding index.php

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

 

#6 2021-01-31 23:53:48

ckayfish
Member
2021-01-25
53

Re: Question mark in address after hiding index.php

Adding “AcceptPathInfo On” to your .htaccess doesn’t allow you to set question_mark_in_urls to false?


--- devOps engineer; sometimes coder. I make your apps run with 99.999% uptime ---

Offline

 

#7 2021-01-31 23:55:57

erAck
Only trying to help
2015-09-06
2031

Re: Question mark in address after hiding index.php

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#8 2021-02-01 00:19:51

simonjonnemeth
Member
2021-01-06
11

Re: Question mark in address after hiding index.php

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

 

#9 2021-02-01 01:33:02

executive
Member
2017-08-16
1214

Re: Question mark in address after hiding index.php

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

 

#10 2021-02-01 02:13:39

ckayfish
Member
2021-01-25
53

Re: Question mark in address after hiding index.php

I thought he was trying his best to be helpful ¯\_(ツ)_/¯


--- devOps engineer; sometimes coder. I make your apps run with 99.999% uptime ---

Offline

 

#11 2021-02-01 02:14:19

simonjonnemeth
Member
2021-01-06
11

Re: Question mark in address after hiding index.php

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

 

#12 2021-02-01 04:31:25

executive
Member
2017-08-16
1214

Re: Question mark in address after hiding index.php

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

 

#13 2021-02-01 06:02:28

executive
Member
2017-08-16
1214

Re: Question mark in address after hiding index.php

I think erack already answered the question

Offline

 

#14 2021-02-01 10:31:59

erAck
Only trying to help
2015-09-06
2031

Re: Question mark in address after hiding index.php

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#15 2021-02-01 12:55:34

Katryne
Member
2016-12-03
369

Re: Question mark in address after hiding index.php

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 ?


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Online

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact