I have a website with a separate blog in a /wordpress/ directory. Currently the blog is available at https://website.com/wordpress/ The blog items do not have a trailing slash and are available at https://website.com/wordpress/newsitem-name
I would like to have the blog available at https://website.com/wordpress (without the trailing slash) and have the trailing slash version (/wordpress/) redirect to the non trailing slash (/wordpress).
I played around with 'DirectorySlash Off', but all I got were incorrect redirects, or infinite redirects. Both broke my site. What do I need to change in my .htacces files?
My website file structure is as follows:
.htaccess (#1)
index.php
otherscript.php
/wordpress
.htaccess (#2)
index.php
other-regular-wordpress-files
.htaccess #1 contains the following:
Options -Indexes
RewriteEngine On
RewriteBase /
#Remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} (.*)$
RewriteRule ^(.*)/$ https://%{HTTP_HOST}/$1 [R=301,L]
.htaccess #2 contains the following:
Options -Indexes
# BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
# END WordPress
What changes do I need to make to be able to visit my blog at "/wordpress"? Thank you very much in advance.