Redirect 301 - I have no idea at this point

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
blahblahwhatever
New Member
New Member
Posts: 9
Joined: Fri Dec 30, 2022 3:32 pm

Redirect 301 - I have no idea at this point

Post by blahblahwhatever »

Hi,

So I have this blog page at https://webastyczny.pl/blog
RewriteBase /blog
and generally creating a slug for a news item broke a news item I had already posted on Linkedin : /
so I want a 301 redirect
adding
Redirect 301 /blog/news/50/4/No-Code-Event-1-by-No-Code-Trojmiasto /blog/news/51/4/No-Code-Event-1-by-No-Code-Trojmiasto
what I get when visiting https://webastyczny.pl/blog/news/50/4/N ... Trojmiasto
is
https://webastyczny.pl/blog/news/51/4/N ... Trojmiasto

Why?
Should I add the /blog/ element or not? I'm confused...

I will be searching for how news slugs are created (btw it would be awesome if the automatic news slug was filled in into the slug input field, just for information and updated when the title is changed) because this /51/4/ or 50/4/ doesn't make sense...
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1665
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Redirect 301 - I have no idea at this point

Post by DIGI3 »

It's hard to diagnose without access to the site, but I see ?page=news in the url so that tells me it's likely one of:
-Pretty urls not enabled correctly, or
-The order of operations in your .htaccess is incorrect (the pretty url rewriting happening after the redirect or something)

Not my area of expertise but usually it's one of those things.

Auto-populating the slug in news articles probably wouldn't be the best idea as it would make the site less portable, but it's also meant to be a pretty basic module. You might want to look at LISE which offers similar functionality with far more options, including Smarty templates for automatically generating urls.
Not getting the answer you need? CMSMS support options
blahblahwhatever
New Member
New Member
Posts: 9
Joined: Fri Dec 30, 2022 3:32 pm

Re: Redirect 301 - I have no idea at this point

Post by blahblahwhatever »

Many CMSes auto populate the slug and it comes handy at times.

I will be investigating. My htaccess seems OK but I will try the original one and start off clean.

Will try to come back when I find the solution.

What is strange, when I entered a slug of my choice, the link to the news item stopped working.
In my template the code for the heading or read more is:
<h2 id="NewsPostDetailTitle">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
</h2>
and
<p class="adnotation">
{$entry->morelink}
</p>
so it seems out of the box, I guess. Unless something changed with 2.x as the page is long before that and updated.
Post Reply

Return to “CMSMS Core”