Hello Community,
I’m again trying to do some stuff with .htaccess and for some reason am not able to.
I want to remove a parameter from my URL. Let me give you an example, let’s say I have something in the lines of MyDomain.com/index.php?band=brend
, I want to make it look like this MyDomain.com/brend
.
I’ve tried a couple of options and so far managed to remove the extention from the link but to that extend.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @brendRos,
Nice seeing you again!
So, I think a redirect like the following should work:
Also, just a quick note, you’ll need to pass your argument to index.php in the backend to make use of them but I’m sure you already know that.
.htaccess how to REMOVE PARAMETERS EXCLUDE SOME PAGES?
I used the following commands in .htaccess to remove the parameters of a URL SUCCESSFUL RewriteEngine on RewriteCond %{QUERY_STRING} !=“” RewriteRule ^(.*)$ /$1? [R=301,L]
For example: https://your-domain.com/product/apple1/?v=e14da64a5617 It will be successful https://your-domain.com/product/apple1/
However, it’s applied to all pages. If I just want to EXCLUDE for the following 2 pages, so how should I edit the .htaccess commands?
Url1: https://your-domain.com/cart/ Url2: https://your-domain.com/checkout/
Hope you can support me, thanks. Nguyen