php - Redirect to a subfolder using htaccess -
i have searched similar topics in forum , nothing helped me. here looking for: have site having login url as
site.com/folder1/php/login.php
now want hide "php" folder name url, remove .php extension like
site.com/folder1/login
also folder name "folder1" may vary, folder name "php" remains same in urls.
try in root/.htaccess
rewriteengine on rewritecond %{the_request} ^[a-z]{3,}\s/?([^/]+)/([^/]+)/([^.]+)\.php [nc] rewriterule ^ /%1/%3 [r=301,l] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([^/]+)/([^/]+)/?$ /folder1/php/$2.php [nc,l]
Comments
Post a Comment