I had a website running at IP (lets say) 11.11.11.11.
My .htaccess is
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
I recently purchased a domain (lets say) mydomain.com and configured it. Website loaded with both IP and domain successfully.
Now, I want to rewrite in a way that all accesses via "IP" are redirected to domain, i.e. 11.11.11.11/contact/sample to be redirected as mydomain.com/contact/sample.
And of course, all other links.
Any help?