Adulty Webmaster Posted March 12 Share Posted March 12 (edited) I'm trying to redirect old url's to new but I'm struggling to figure this out within my .htaccess # seo redirect rules --------------------------------------------------------------------------------------------------- RewriteRule ^latest-updates/([0-9]+)/$ /latest-videos/([0-9]+)/$/ [R=301,L,QSA] RewriteRule ^latest-updates/$ /latest-videos/$/ [R=301,L,QSA] # redirect all index.php to the folder root RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ /$1 [R=301,L] # redirect all script.php/blabla to website root RewriteRule ^.+\.php/ / [R=301,L] # automatically add slash at the end RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\..+$ RewriteCond %{REQUEST_URI} !/$ RewriteCond %{REQUEST_URI} !^/embed/ RewriteRule (.*) /$1/ [R=301,L] RewriteRule ^([0-9]+)/([^/]+)/$ /videos/$1/$2/ [R=301,L] # global --------------------------------------------------------------------------------------------------------------- RewriteRule ^sdfsdfsdf/$ terms.php [L,QSA] RewriteRule ^terms/$ terms.php [L,QSA] RewriteRule ^dmca/$ dmca.php [L,QSA] RewriteRule ^2257/$ 2257.php [L,QSA] RewriteRule ^search/([^/]+)/$ search.php?q=$1 [L,QSA] RewriteRule ^search/$ search.php [L,QSA] RewriteRule ^link/([^/]+)/$ redirect_cs.php?dir=$1 [L,QSA] RewriteRule ^random_video(/)?$ redirect_random_video.php [L,QSA] RewriteRule ^random_album(/)?$ redirect_random_album.php [L,QSA] # posts example -------------------------------------------------------------------------------------------------------- RewriteRule ^news/$ posts_list.php?post_type=news [L,QSA] RewriteRule ^news/([0-9]+)/$ posts_list.php?post_type=news&from=$1 [L,QSA] RewriteRule ^news/([0-9]+)/([^/]+)/$ view_post.php?id=$1&dir=$2 [L,QSA] RewriteRule ^news/([^/]+)/$ view_post.php?dir=$1 [L,QSA] # videos --------------------------------------------------------------------------------------------------------------- RewriteRule ^latest-videos/([0-9]+)/$ videos_list_latest.php?from=$1 [L,QSA] RewriteRule ^latest-videos/$ videos_list_latest.php [L,QSA] I'm basically trying to redirect my old url /latest-updates/ to /latest-videos/ Can somebody explain what i'm doing wrong here? Edited March 12 by Adulty Webmaster / edit Quote Link to comment Share on other sites More sharing options...
Tech Support Posted March 13 Share Posted March 13 Should be these: RewriteRule ^latest-updates/([0-9]+)/$ /latest-videos/$1/ [R=301,L,QSA] RewriteRule ^latest-updates/$ /latest-videos/ [R=301,L,QSA] Quote Link to comment Share on other sites More sharing options...
Adulty Webmaster Posted March 13 Author Share Posted March 13 (edited) 12 hours ago, Tech Support said: Should be these: RewriteRule ^latest-updates/([0-9]+)/$ /latest-videos/$1/ [R=301,L,QSA] RewriteRule ^latest-updates/$ /latest-videos/ [R=301,L,QSA] I've done this but still directs to a nginx 404 page? also this is suppose to be added underneath # seo redirect rules correct? Edited March 13 by Adulty Webmaster edit Quote Link to comment Share on other sites More sharing options...
Tech Support Posted March 13 Share Posted March 13 This is likely because your server doesn't have Apache installed and .htaccess file is not used at all. Please check with your server support about this. Quote Link to comment Share on other sites More sharing options...
Adulty Webmaster Posted March 13 Author Share Posted March 13 6 minutes ago, Tech Support said: This is likely because your server doesn't have Apache installed and .htaccess file is not used at all. Please check with your server support about this. I can confirm: Apache/2.4.37 (AlmaLinux) Quote Link to comment Share on other sites More sharing options...
Tech Support Posted March 14 Share Posted March 14 Then please create support ticket. Quote Link to comment Share on other sites More sharing options...
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.