Hi, I am using mod_jk in apache to host my website. On launching http://mysite.com the home page needs to be displayed but currently it is displayed in the URL as http://mysite.com/corporate/index. Can any of you suggest a way to rewrite this URL as http://mysite.com thanks
i'm not sure what mod_jk is .. but here are standard rewrite rules that should work for you (hopefully) RewriteEngine On RewriteRule ^$ /corporate/index [L,NC] RewriteRule ^/$ /corporate/index [L,NC] Code (markup): that should do the trick ..
I tried what you suggested but this is redirecting my page to http://mysite.com/corporate/index. Meaning in the address bar this URL appears. But that is not what is required. the /corporate/index shoudl be hidden. Any clues?
Let me get this straight... When you view http://www.mysite.com/ you want the page that's currently at http://www.mysite.com/corporate/index to be displayed ? Why not move that file one directory level up ?
As per powerspike's suggestion, if going to http://www.mysite.com/ redirects you to http://www.mysite.com/corporate/index then the RewriteRule in your configuration file most probably has [R] after it or possibly [R=301]. Get rid of that [R] and the Rewrite should work properly. You should only need one of the RewriteRules he provided. One will work in a .htaccess file and the other will work in your httpd.conf file.
Hi Ladadadada, I have found some apache setups with without / in the rule, some need / in the rule, so i always supply both. ok, try this, backup your current .htaccess file (copy them into a notepad or something ), put the above rules at the TOP of your .htaccess file, copy and paste them, there might be other rules with some type of redirect in them. apache parses htaccess from top to bottom, the L in the brackets means last rule, if one of the two above rules are matched, it'll stop looking for others (which is what you want). the nc means no case for reference.