Thread Starter
Taswir
(@taswir)
Hi John,
Thank you very much for your reply.
I checked with my hosting provider and they confirmed that everything is fine from their server end. They asked me about the .htaccess redirection rule, so can we use the following one to force trailing slash to get rid of this issue:
# Force trailing slash
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]
Thank you very much.
I’m a bit confused – is this a solution or a question? You didn’t mention having a problem with trailing slashes originally.
The page I linked to is about the server directly serving static files before Redirection has chance to run, and so you need to save the redirects to your .htaccess file. You can also modify your server to check that static files exist before it tries to serve them.
Thread Starter
Taswir
(@taswir)
Hi John,
Actually what I found that those non-exist html pages do not redirect to my current live pages.
So basically what I am trying to do is –
source page – https://www.example.com/page.html/
target page – https://www.example.com/
non-exist page – https://www.example.com/page.html (when i force it with trailing slash, it redirects to the source page and then target page)
I am wondering whether adding trailing slash is the acceptable solution for this.
Thank you very much.
-
This reply was modified 7 years, 1 month ago by
Taswir.
> I am wondering whether adding trailing slash is the acceptable solution for this.
I still don’t really understand what the problem is. If it helps your situation then by all means do it. With regards to Redirection, if you have issues redirecting URLs that end in .html then you can use the link I added above.