Sorry about accidental multiple posts…I can’t even access those now
trying to strip “index.php?” from urls. It pulls out index.php but leaves “?”
I tried to include htaccess code but attempt to use markdown failed. Any files I try to attach are “not allowed”
Why can’t these post fields just be rich text fields?
I would strip the htaccess code back to nothing first and then work from there. My guess is that it’s something on the server set up.
Follow the instructions here - https://docs.expressionengine.com/latest/installation/best-practices.html#removing-indexphp-from-your-urls and then once it’s working add the caching and redirects back in.
Here is one thing I tried with mixed result
RewriteRule (.?)index.php/(.*) /$1$2 [R=301,NE,L]
add [QSD] to RewriteRule
RewriteRule (.?)index.php/(.*) /$1$2 [R=301,NE,QSD,L]
This strips out the query string but alas it treats everything after the ? as query string. So..
https://www.trekalaska.com/index.php?/destinations/denali-state-park
becomes
https://www.trekalaska.com/
without the [QSD] it becomes
https://www.trekalaska.com/?/destinations/denali-state-park
query string disabled in CP
These links are old one that Google still checks so produces errors. Links with index.php not being generated by current site
Try this:
RewriteRule ^index.php$ %{QUERY_STRING} [R=301,NE,QSD,L]
This should match https://www.trekalaska.com/index.php?/destinations/denali-state-park
and return https://www.trekalaska.com/destinations/denali-state-park
Note that it will match ONLY index.php, not any sub-path, and also that if the query string has more fluff than just the EE segments, that’ll still be appended after the rewrite, which might not be what you want.
…I used this to help: https://htaccess.madewithlove.com/
I spoke too soon :-(
https://www.trekalaska.com/index.php?/destinations/denali-state-park
returns
https://www.trekalaska.com/destinations/denali-state-park
which is perfect
However… https://www.trekalaska.com/index.php/destinations/denali-state-park
Returns https://www.trekalaska.com/index.php/destinations/denali-state-parks
and a 404 error
It strips out “index.php?” But not “index.php”
Also, a URL like https://www.trekalaska.com/?/destinations/denali-state-park
outputs no change and a 404
so am trying to strip out any of the following
“index.php” - “index.php?” - “?”
Yes. That was removed in settings.
It’s getting rid of “index.php?” or “?” that is a problem
https://www.trekalaska.com/index.php?/alaska-hiking-trips/wrangell-st-elias-national-park
redirects to…
https://www.trekalaska.com/?/alaska-hiking-trips/wrangell-st-elias-national-park
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.