I am using the following htaccess code in my website:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([^/.]+)?/?([^/.]+)?/?$ switch.php?one=$1&two=$2 [L]
switch.php has a code that helps my dictionary website to present nice looking addresses.
Lets say that the word XXX in the dictionary is clicked, then the address will be: example.com/XXX
(all by using the same "page.php" file for all the words in the dictionary.
Another example, a user can write the address example.com/YYY and he will be directed to the YYY page which will use "page.php" file and be shown in the address-bar as "example.com/YYY.
My problem is that I want to strip off the www from all my pages but still use my code. so any www.example.com/XXX will be example.com/XXX
I tried many ways to do it but all the strip off www codes do not work well with my code. (I need the switch.php to keep working as I do not want to change the addresses of my website, just to remove www from the pages)
I appreciate anyone who could help me with a solution. I do not mind using 301 direct as well as long as the switch.php still works.
Thanks!