I have made a redirect rule in my .htaccess file for https://pg-flowsolutions.com that specifies that if someone enters an invalid path (for instance https://pg-flowsolutions.com/blablabla) the visitor should be redirected to the websites index.
Now this works fine in Google Chrome, but in Safari and IE I'm experiencing that an extra 's' is appended to the address bar, so the browser is attempting to open httpsS://pg-flowsolutions.com - which obviously creates an error.
So the error I am looking for help to solve is where the extra 's' that is included in the address bar when opening a invalid URL actually comes from.
Is it something in my .htaccess file that causes this, can the extra 's' be caused by some server settings in Apache, or is it perhaps something that can be corrected in Wordpress even?
I have not been able to identify what causes this behaviour, my .htaccess file is the suspected culprit but I have not been able to find any errors there.
It currently forces all HTTP visitors of the site to the HTTPS version, and also it is supposed to redirect all attempts to open an non-existing page to the index site.
As mentioned, this works for me in Chrome but not other browsers.
My .htaccess file looks like this
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
.htaccess
file? Please include the HTTP response headers in your question. The problem is not in the.htaccess
file you have posted. But the code you posted doesn't "redirect the visitor to the websites index", it internally rewrites the visitor's request to index.php - this is probably what you meant, but it is quite different and does not involve a redirect..htaccess
) to route "invalid paths"? Entering an invalid WP URL should be resulting in a WP generated 404 - but it is not, so you have other code that is intercepting this? Incidentally, if you really did want to "redirect invalid paths to the websites index" then you can't do this using.htaccess
if you are using WordPress.