Current directory structure:
wwwpublic
|+ spanish(language)
|-- index.php
|-- contact.php
|
|- index.php
|- aboutus.php
|- products.php
|- contact.php
In the root of wwwpublic directory I have files in the English language. Since site have Spanish language too, I have created separate directory named ‘spanish’. Name of pages are exactly the same in both directories.
Now, some pages in spanish directory don’t exist and I need to redirect request to such pages to root folder and retain name of file requested.
Example:
Visitor go to Spanish version, open index.php there, then he clicks on aboutus.php page (dont exists) inside spanish directory and then .htaccess redirects him to the /root/aboutus.php
Try something like this in your
wwwpublicdirectory, preferably before any routing rules you may have: