htaccess mod_rewrite remove one parameter from url without redirecting

Viewed 50

i have a subdomain which i attached to one of my hosting by updating it's CNAME, now it's pointed to a website, but i want to remove a specific parameter from that URL, for example

http://menu.sogustocafe.com/menu-sogusto

here's a domain and i want to remove "menu-sogusto" from this URL, when i open http://menu.sogustocafe.com/ i want to see the page which appears on http://menu.sogustocafe.com/menu-sogusto this URL, you can check the menu.sogustocafe.com CNAME records to clear the situation

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^menu.sogustocafe.com
RewriteRule    .*  /menu-sogusto [PT]
</IfModule>

here's the code i've tried from google, but it isn't working

1 Answers

With your shown samples, please try following rules in your .htaccess file. Please make sure to clear your browser cache before testing of your URLs.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^menu\.sogustocafe\.com$ [NC]
RewriteRule  ^/?$  menu-sogusto [L]
</IfModule>
Related