Redirect Error for Other than index.hmtl

Website URL

https://soywanbos.synergize.co/

Error Message

error 404

Other Information

Hello everyone, I need help with redirect issues. As of now, there are 3 files for my site and I encounter problem when I try to redirect products and about into /products and /about-us but everything works fine when I redirect index into /

All 3 files are in same directory which is inside htdocs folder. I have tried to use htaccess script and redirect functions in control panel of infinityfree but no success.

Below are script for htaccess

and below are parts of html nav code that i use

You’ve made a rule that rewrites product.html to /products, but from my understanding you want to do the opposite, rewrite /products to product.html.

Your rewrite rules need to have their order changed, with any other changes in syntax that might be needed as a result.

8 Likes

I actually want to do from product.html to /products for example by default the URL will be ‘synergize.co/products.html’ but I want to make it into ‘synergize.co/products

Right now, you have .htaccess rules that redirect people from /products.html to /products. However, there is no file or directory named /products, and no code to route it to another file. So the server doesn’t have any code to handle /products.

If my assumptions are correct, you want people to see the page /products.html but use the URL /products? If so, then you’ll probably want an extra .htaccess line which looks something like this (untested):

RewriteRule ^products$ /products.html [NC,L]

Alternatively, there are .htaccess snippets which remove the file extension for all files all at once. Something like this:

8 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.