Forum Moderators: phranque

Message Too Old, No Replies

htaccess question

         

karmargin

7:26 pm on Dec 4, 2006 (gmt 0)

10+ Year Member



I've recently moved my site to new server and have started using php instead of html.

I've built my site so that it always references a folder "/example/" instead of "/exapmle/index.html".

However, some of my old pages "/index.html" got listed.

So now that my site is php and not html i would like to use a htaccess file to to redirect all "index.html" pages to "/". Can that be done? Would i use a mod_rewrite or 301?

cheers

jd01

7:49 pm on Dec 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Karmargin,

Welcome to WebmasterWorld!

The best place to start getting an understanding of what you will need to do is in the library.

Apache Tutorials [webmasterworld.com]

What you will eventually end up doing is use mod_rewrite to generate a 301 redirect from /index.html to /.

Try your favorite search engine and you should be able to find a large number of examples of the exact code you are looking for here on WebmasterWorld.

EG
Redirect /index.html to / site:webmasterworld.com
(or something to that effect.)

Hope this helps.
Justin

karmargin

8:37 pm on Dec 4, 2006 (gmt 0)

10+ Year Member



Thanks for your help. All i've found so far is to redirect index.html to index.php. Will it work to go from index.html to /?

jdMorgan

10:26 pm on Dec 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See this thread: [webmasterworld.com...]

Jim