Forum Moderators: phranque
http://www.example.com
and
http://www.example.com/
and
http://www.example.com/index.html
?
Also, I how do I write my htaccess, so that it takes all of these into account, and also handles the [www....] vs. http:// into account.
My site is set up to be www.
My real goal here though is to understand what is happening.
Thanks for those brave enough to answer.
dk
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
</IfModule>
That should set you up. The first rewrite rule redirects all calls to http://example.com to http://www.example.com
The second one redirects index.php to /
[edited by: jdMorgan at 3:02 am (utc) on April 16, 2006]
[edit reason] Formatting [/edit]
I am still trying to learn the basics of what an htaccess file is. I am using one successfully, and I get what a 301 redirect is, but I still don't get what language this is, what any of the syntax means. Basically a big... Duh?
Do you have any recommendations on where I can read a simple tutorial on what language is being used, and the basics of the syntax and structure of the language.
Thanks tons!
dk
Jim