How to remove session id "/?___SID=U" from home page URL using .htaccess

533 views Asked by At

I want to remove session id from the home page URL using .htaccess file.

I have tried it so many time but can't succeeded. I have disabled the option from the back-end in the session validation setting use sid on front-end I have disabled it but it can't work.

Please suggest me, what is the proper way to remove the session id from home page URL?

1

There are 1 answers

0
anubhava On BEST ANSWER

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{QUERY_STRING} _SID= [NC]
RewriteRule ^/?$ /? [L,R=302]