Good morning everyone,
I'm reaching out for assistance with rewriting a URL. My objective is to modify the URL https://voorbeeld.nl/pagina/lid-worden.html to https://voorbeeld.nl/lid-worden by removing the /pagina/
folder from the URL.
Here are some of the RewriteRules I've attempted:
RewriteEngine On
#Rewrite from /pagina/lid-worden.html to /lid-worden
RewriteRule ^pagina/(.*)\.html$ /$1 [R=301,L]
RewriteEngine On
#Rewrite from /pagina/lid-worden.html to /lid-worden
RewriteRule ^pagina/lid-worden\.html$ /lid-worden [R=301,L]
RewriteEngine On
#Rewrite from voorbeeld/pagina/lid-worden.html to /lid-worden
RewriteRule ^voorbeeld/pagina/lid-worden\.html$ /lid-worden [R=301,L]
However, I haven't achieved success with these attempts as it shows
The requested URL was not found on this server.
when visiting https://www.voorbeeld.nl/lid-worden
The folder voorbeeld contains the following folders & files
- /assets
- /pagina (contains the file lid-worden.html)
- .htaccess
- index.html
I must admit that my knowledge and understanding of URL rewriting are quite basic. Therefore, I'm really hoping to receive some assistance in order to achieve the desired success in this area. Any guidance or support would be greatly appreciated.
If there is any additional information I have missed or overlooked, please do not hesitate to let me know. I will make every effort to acquire the necessary details to address your requirements effectively.
Important Note
I want to draw your attention to an important detail. The domain name and folder name referred to as "voorbeeld" in this text are simply examples I have chosen to protect the privacy of the actual domain or website. It's crucial to understand that these names are not real and are used solely for demonstration purposes.