old referal links redirect or search and suggest

soaringeagle
@soaringeagle
9 years ago
3,304 posts
is there any way to add something to my 404 template that woulkod do 1 of the following
1 prefered.. catch the url that was used to direct to that page and add a 301 permenently moved to new location
2 if that cant be doner do a search for the most likely title taken from the url and offer "is this what your looking for ' suggestions


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities

updated by @soaringeagle: 07/05/15 01:03:50PM
michael
@michael
9 years ago
7,715 posts
Make sure you have the:
ACP -> SYSTEM CORE -> GLOBAL CONFIG -> LOG 404 NOT FOUND

checkbox checked, that will allow you to see what URLs people are hitting in your activity log.

From there you can use the url mapper to send them where you know they want to go:

"Url Mapper"
https://www.jamroom.net/the-jamroom-network/networkmarket/179/url-mapper

--
If you still want something for your 404.tpl page then yes the referer is there:
http://www.smarty.net/docsv2/en/language.variables.smarty

so in:
/skins/YOUR SKIN/404.tpl

You can see the referer with this variable:
{$smarty.server.HTTP_REFERER}

although thats probably not so useful in searching for extra similar pages.

I guess you could make a custom smarty function that took the referer as a variable and outputted possible choices for other pages, but im not sure why you would do that because for the referer to be there there has to be a link to the page from one of your pages and there is not much point in purposely linking to a page that is not there.

If you did want to though....

"Defining your own smarty function"
https://www.jamroom.net/the-jamroom-network/documentation/development/1569/defining-your-own-smarty-function
soaringeagle
@soaringeagle
9 years ago
3,304 posts
ok i do have the 404 thing on andthe url mapper sounds like the right way to go but its awhole lot of links....tons but thats a permenent redirect right wich is whats best for seo


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities

Tags