0

I am trying to rewrite the "home page" of the website to www.example.com.

The home page right now can be accessed via www.example.com/dir/userdo?action=home

My thoughts are www.example.com is really www.example.com/index.html since apache auto hide the /index.html, so I tried

RewriteRule /index.html /dir/user.do?action=home [PT,L]

which does not work.

Can someone give me an idea the right approach to this problem? Thanks

Will
  • 900
  • 10
  • 20

1 Answers1

0

RewriteRule ^/$ /dir/userdo?action=home [L]

the default index.html can be changed with DirectoryIndex directive.

changx
  • 1,937
  • 1
  • 13
  • 10
  • ty, the page now shows up, but all the css, images which are under `dir/cssimage` failed to load. I check the web console, which seems application is requesting `/cssimage` directory which does not exists under root folder. any idea what went wrong? – Will Dec 08 '11 at 04:29
  • this rewrite rule does not affect the url which browser think all resources should be located at / (eg. /cssimage). Here is addition rules to fix that, `RewriteCond %{REQUEST_FILENAME} !-f` `RewriteRule ^(.*)$ /dir/$1 [L]` . These rules will redirect all request that file not exists to /dir/ . – changx Dec 08 '11 at 06:35