maaaaaars Posted May 16 Posted May 16 Changing a URL (directory) doesn't redirect to the new URL nor does it cease to exist. For example, If I change the video's directory from abc to xyz, both pages are still available on the website: site.com/videos/abc site.com/videos/xyz Furthermore, the old URL displays the following error: Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, null given in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php:13 Stack trace: #0 /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php(13): array_slice() #1 /www/wwwroot/site/admin/smarty/Smarty.class.php(1877): include('...') #2 /www/wwwroot/site/admin/smarty/template-c-site/%%59^590^59079386%%video_comments_video_comments.tpl.php(94): Smarty->_smarty_include() #3 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #4 /www/wwwroot/site/admin/include/process_page.php(2058): Smarty->fetch() #5 /www/wwwroot/site/admin/smarty/internals/core.run_insert_handler.php(51): insert_getBlock() #6 /www/wwwroot/site/admin/smarty/template-c-site/%%6D^6D1^6D168B67%%view_video.tpl.php(6): smarty_core_run_insert_handler() #7 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #8 /www/wwwroot/site/admin/include/process_page.php(1534): Smarty->fetch() #9 /www/wwwroot/site/view_video.php(1): require_once('...') #10 {main} thrown in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php on line 13 However, there are generally no issues with this file, as it's working correctly on other video pages, both those with and without comments. How can I have the old URL redirect to the new one after changing the directory? Alternatively, if that's not possible, how can I have the old URL removed from the site? Please note that manual solutions, such as creating the redirect manually in .htaccess, isn't ideal as that there will be more (potentially hundreds of) videos with changed directories. Quote
Tech Support Posted May 17 Posted May 17 The video page URL will only redirect when it is using video numeric ID, otherwise it won't do any redirect, because it doesn't know where to redirect to. 21 hours ago, maaaaaars said: Furthermore, the old URL displays the following error: Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, null given in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php:13 Stack trace: #0 /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php(13): array_slice() #1 /www/wwwroot/site/admin/smarty/Smarty.class.php(1877): include('...') #2 /www/wwwroot/site/admin/smarty/template-c-site/%%59^590^59079386%%video_comments_video_comments.tpl.php(94): Smarty->_smarty_include() #3 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #4 /www/wwwroot/site/admin/include/process_page.php(2058): Smarty->fetch() #5 /www/wwwroot/site/admin/smarty/internals/core.run_insert_handler.php(51): insert_getBlock() #6 /www/wwwroot/site/admin/smarty/template-c-site/%%6D^6D1^6D168B67%%view_video.tpl.php(6): smarty_core_run_insert_handler() #7 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #8 /www/wwwroot/site/admin/include/process_page.php(1534): Smarty->fetch() #9 /www/wwwroot/site/view_video.php(1): require_once('...') #10 {main} thrown in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php on line 13 This looks to be related to some PHP8 and template issue, we will take a look at this and provide some feedback later. 21 hours ago, maaaaaars said: Alternatively, if that's not possible, how can I have the old URL removed from the site? I'm not sure why you need to remove the old URL? When you change video directory to a new value, and your video URLs are not using numeric IDs, then old URL starts giving 404 error and no more exist, so there is no need to remove it from anywhere. It may be possible that for some short period of time the cached templates will continue showing the old URL, but this will resolve automatically within hours. 21 hours ago, maaaaaars said: Please note that manual solutions, such as creating the redirect manually in .htaccess, isn't ideal as that there will be more (potentially hundreds of) videos with changed directories. This is the only possible solution for now... In order to avoid this it is recommended to use video IDs in URLs in some way, which is the default behavior. Quote
Tech Support Posted May 21 Posted May 21 On 5/16/2024 at 9:37 AM, maaaaaars said: Furthermore, the old URL displays the following error: Fatal error: Uncaught TypeError: array_slice(): Argument #1 ($array) must be of type array, null given in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php:13 Stack trace: #0 /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php(13): array_slice() #1 /www/wwwroot/site/admin/smarty/Smarty.class.php(1877): include('...') #2 /www/wwwroot/site/admin/smarty/template-c-site/%%59^590^59079386%%video_comments_video_comments.tpl.php(94): Smarty->_smarty_include() #3 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #4 /www/wwwroot/site/admin/include/process_page.php(2058): Smarty->fetch() #5 /www/wwwroot/site/admin/smarty/internals/core.run_insert_handler.php(51): insert_getBlock() #6 /www/wwwroot/site/admin/smarty/template-c-site/%%6D^6D1^6D168B67%%view_video.tpl.php(6): smarty_core_run_insert_handler() #7 /www/wwwroot/site/admin/smarty/Smarty.class.php(1271): include('...') #8 /www/wwwroot/site/admin/include/process_page.php(1534): Smarty->fetch() #9 /www/wwwroot/site/view_video.php(1): require_once('...') #10 {main} thrown in /www/wwwroot/site/admin/smarty/template-c-site/%%10^109^109F0088%%include_content_comments.tpl.php on line 13 We don't see array_slice() function usage inside this template, so likely this could be related to your theme customization. Please create support ticket if you want us to take a look. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.