Thank you for your time. I have done almost everything but I am stuck here in the redirect part Here is my full .htaccess code
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.(css|js|jpg|jpeg|png|gif)$
RewriteCond %{REQUEST_URI} !^/ecom-book/eng/
RewriteRule ^ecom-book/(.*)$ /ecom-book/eng/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^eng/(.*)$ $1 [L,QSA]
RewriteRule ^product/(.*)/(.*) product.php?id=$1&name=$2 [L]
ErrorDocument 403 /cgi-sys/403_def.html
ErrorDocument 404 /cgi-sys/404_def.html
ErrorDocument 500 /cgi-sys/500_def.html
ErrorDocument 502 /cgi-sys/502_def.html
ErrorDocument 503 /cgi-sys/503_def.html
ErrorDocument 504 /cgi-sys/504_def.html
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^example\.in$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.in$
RewriteRule ^/?$ "https\:\/\/example\.in\/" [R=301,L]
<IfModule mime_module>
AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
This code dont work as expected to I have handled to ignore /eng/ too.
But I am having issue when I added this line-
# Redirect to the /eng/ version of genre.php if /eng/ is not present in the URL
RewriteCond %{REQUEST_URI} !^/ecom-book/eng/
RewriteRule ^ecom-book/(.*)$ /ecom-book/eng/$1 [R=301,L]
It goes into redirect loop if I dont include ecom-book I have this url I hit - https://localhost/ecom-book/genre.php And want a redirection to - https://localhost/ecom-book/eng/genre.php WHEN /eng/ is not present after localhost/ecom-book/
Please help me fix that issue I tried some already answered if you have any answer to refer to thanks a lot for you time. Please let me know a fix for both localhost and live server with domain