Forum Moderators: phranque
Check the previous threads here and post your best effort code as a basis for discussion.
However, I will note that redirecting your root URL to a deep internal page is not the best of things to be doing.
You will also need to check both www and non-www responses, and what happens when you include the index file filename in the request - those others also need to redirect, otherwise you are serving the same page of content at multiple URLs.
Just before that "catch all" rule, you will need one to strip off the index file filename if one is requested.
So, three (at least) rules in all, and their order is important.
You don't need the line
RewriteBase / as that is the default anyway.
RewriteBase / line. You don't need it. Put the
RewriteEngine On line at the very top of the page, above the rules. Copy the two-line rule out twice so you have two copies of it.
First copy:
Delete the
RewriteCond line completely. (.*) to be ^$ Second copy:
Change
/home/ to be /$1 Finally, go fetch the redirect for named index files that redirects back to "/" rule that has been posted every day this week, and insert it between those two rules.
Post back here when done.
Additionally, your rule only now works for the www version, because it only tests for www.yoursite.com URLs.
Change what you have above so that
www.\ becomes (www\.)? Note that your code has .\ when it should be \. and that you must add the ( and ) and ? to it.
This stuff does exactly what you type and is completely unforgiving of typos and misunderstandings.
Finally, you will need to look at the other rules I suggested. To not do so is letting your site serve Duplicate Content.
[edited by: g1smd at 10:04 am (utc) on Sep. 30, 2008]
Now take a look at the other two rules that you will need to add to do the job properly.
One is to fix things so that index filename requests have the "index" filename stripped off - that code is in many other threads here.
The other is to redirect all non-www requests to www - I posted how to do that, above.
Feel free to post specific questions here -- Our purpose here is to help you learn, not to simply provide cut-and-paste code.
Jim
is it fine now?
[edited by: jdMorgan at 6:52 pm (utc) on Sep. 30, 2008]
[edit reason] example.com [/edit]