When I enter the website.com/seo
link, I want to make a 301 redirect to the website.com/seo/
link. However, I don’t want it to be broken in the codes I wrote in the current htaccess.
my htacces codes:
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).php [NC]
RewriteRule ^ %1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
2
Answers
Use only one of these, do not use together!
Try:
If that doesn’t work, use:
Remove the previous rules, and try once. If it works after removing previous rules, then let me know.
Based on your shown samples, could you please try following. Please clear browser cache before testing your URLs