mod_rewrite help please!

MizugoriMizugori NYC
edited January 2006 in Internet & Media
ok basically i have a website, for example:

website.com

i want to create a new page, for example page.html, and i want my visitors to be able to type in:

website.com/page

and get to the page. instead of them having to type in:

website.com/page.html

i was told that i can do this via mod_rewrite and a .htaccess file. i googled but im really confused and it looks like you have to ALREADY know what the hell you are doing in order to code this. could someone help me?

thanks a lot!

Comments

  • KwitkoKwitko Sheriff of Banning (Retired) By the thing near the stuff Icrontian
    edited January 2006
    //EDIT: After a little more research and testing, I found the following and it seems to work:
    RewriteEngine on
    RewriteRule ^([A-Za-z0-9-]+)?$ /$1.html [R=301,L]
    
    Let me know if it works.
  • MizugoriMizugori NYC
    edited January 2006
    sick, thank you, seems to work :)
  • KwitkoKwitko Sheriff of Banning (Retired) By the thing near the stuff Icrontian
    edited January 2006
    Well it worked on my machine too, so I guess it's good to go.:thumbsup:
Sign In or Register to comment.