Closed localhorst closed 1 year ago
I'm unable to reproduce.
foobar
/foobar
after it:So something else must be going on here.
Perhaps your site is multi-site, and you didn't set the field to be enabled for all of the sites?
Perhaps some kind of Ngnix or other server config is interfering here?
The fact that the short link apparently isn't even saved makes me think something very strange is going on here... have your checked your web.log
for any errors?
Will re-open if I can be given a way to reproduce this issue.
I managed to get it working. I guess it was related to a missing 404 configuration and active logins into the backend / control panel. So if you run into this problem, make sure to get your 404 page running and also test your shortlinks in a browser without an active control panel session.
FWIW, I did have an active session in the CP when I did my tests above.
I have the exact same issue, but with a Craft 3 installation (retour 3.2.7). Most of the time the "short link" list was empty (like OP mentioned), sometimes the short like was created, but it would redirect from "/" to "/". After changing these values the redirect was stored as a normal redirect (not a short link).
I dug into the web.log and found some errors regarding retour:
2023-02-24 12:13:23 [-][1][-][error][nystudio107\retour\controllers\RedirectsController::actionEditRedirect] Couldn't load redirect id 139
2023-02-24 12:13:23 [-][1][-][info][application] $_GET = [
'p' => 'beheer/retour/edit-redirect/139'
]
Any ideas?
@FrDH what does that redirect id 139 look like in your db?
OP's problem ended up being something I couldn't reproduce, and something that ended up being solved on their end.
Try the advice that I gave them?
It's not a multi-site, we have a functional 404 page and I was logged in when editing the page. Checking the web.log was all that was left to do.
I had a look at the DB and found:
retour_redirects
table is emptyretour_static_redirects
table has 117 rows, with 127 as the highest ID.Table information for the retour_static_redirects
:
engine: InnoDB
encoding: utf8
auto_increment: 143
This is all just FYI, if it doesn't ring any bells, we'll just add the redirects manually. Thanks.
@khalwat I'm seeing the same issue. When I save an entry with a populated short link field, no redirect is created.
If anyone who is having this issue can send me a db dump & your composer.json
file to:
andrew@nystudio107.com
...that would be most appreciated. I'm unable to replicate this locally.
@khalwat I've shared a stripped down version of the website with you.
@thulstrup How have you shared it? I'm not seeing it in my email?
Got it now, thanks, this should be helpful!
@thulstrup I'm unable to reproduce this with your db dump & composer.json
I've imported the db, logged in, and created an entry with a short link without issue
Is there something environmental that might be going on here?
Some questions:
a. Is there anything in logs? b. When you say "no redirect is created", do you mean in the DB? In the CP it would appear under the "short links" section. Have you validated that the created short link won't work?
@khalwat
a) Nothing in the logs except Retour statistics cleared
and Retour plugin loaded
.
b) I added a video showing the problem to the Dropbox I shared with you.
I did make some progress though. I discovered that short links are created for new entries just not for existing one.
So the reason this was hard to reproduce is that it only happened on an entry that has max revisions already.
Addressed in: https://github.com/nystudio107/craft-retour/commit/020e902bf9f8b8194d0812af8ee4fcb78f5c91bf & https://github.com/nystudio107/craft-retour/commit/06f3e2884a119630dd5ee4ff0cbc66606838dcd9
Craft CMS 3:
You can try it now by setting your semver in your composer.json
to look like this:
"nystudio107/craft-retour": "dev-develop as 3.2.9",
Then do a composer clear-cache && composer update
…..
Craft CMS 4:
You can try it now by setting your semver in your composer.json
to look like this:
"nystudio107/craft-retour": "dev-develop-v4 as 4.1.11",
Then do a composer clear-cache && composer update
I tested with Craft CMS 4 and it works 🙂 Thank you for taking the time and fixing the issue.
Describe the bug
Short links not working on website, Craft 4.3.3. I get a 404 error when calling the short link url. Redirects are working correctly.
To reproduce
HTTP 404 – Not Found – yii\web\NotFoundHttpException Template not found: foobar
Expected behaviour
Versions
(Edited again, I thought I had one successful redirect when using two slashes, but it was a fluke. Sorry :). )