Thread Starter
CZNeo
(@czneo)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
RewriteCond %{HTTP_HOST} ^zelenenoviny\.cz [NC]
RewriteRule ^(.*)$ http://www.zelenenoviny.cz/$1 [L,R=301]
Thread Starter
CZNeo
(@czneo)
Thank you for the answer!
however, it seems as if nothing’s changed. When I put http://www.mydomain.cz in the address bar I am redirected to mydomain.cz
My goal was to do that the other way round. Anyway, I tried to tweak your code by switching Condition and Rule
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Didn’t work either.
Thread Starter
CZNeo
(@czneo)
Thanks for all the suggestions. In the end, my webhost just said that he allowed wildcard but he did not 🙂