Forum Moderators: coopster
Options +FollowSymlinks
rewriteengine on
rewriterule ^(.+)\.html$ [mydomain.com...] [r=301,nc]
However, this means that all my pages are going from html to php while I still have some subdirectories that I can't switch now. How would the .htacess file have to look then?
Also, I'm still using this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*)$ [mydomain.com...] [R=permanent,L]
to make everyone typing [mydomain.com...] being automatically taken to [mydomain.com....]
Is there a way to make both work at the same time?
Thanks!
As for subdirectories, I think you'll have to put an .htaccess file in each of them with similar code to what you already use, but specific to that directory, e.g.
Options +FollowSymlinks
rewriteengine on
rewriterule ^subdirectory/(.+)\.html$ http://www.mydomain.com/subdirectory/$1.php [r=301,nc]
Options +FollowSymlinks
rewriteengine on
rewriterule ^(.+)\.html$ [mydomain.com...] [r=301,nc]
would change all html's into php's. For example I have a link from my main page to [mydomain.com...] which also gets changed into [mydomain.com...] This is what I have to avoid since I can't yet change the html files in some of my subdirectories.