I'm trying to rewrite my portfolio URLs within a htaccess file. I have this code and it work to some extent.
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$ RewriteRule ^(.*)$ $1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^\.]+)/$ $1.php However the issue is that I have a blog in a folder and when I try to go to another page from the blog page the URL does not get formatted right. Ex. cgarcia.design/blog/about/ and it should be cgarcia.design/about/.
Any suggestions on how I can fix the code to properly rewrite my URLs with a trailing slash that also work with sub directories?
/blog/also have a .htaccess? If yes then post it in question.