Page 1 of 1

redirect from directory to static page

Posted: Mon Mar 05, 2007 4:30 pm
by proberlin
hi all,

i searched the forums for an solution of the following problem, but i couldn't find one:

i have s9y 1.1 installed (in the root directory) and url rewriting was automatically disabled (i guess my server doesn't support it). i am also using the staticpage-plugin.

what i would like to do is: redirecting from a directory to a static page, for example:

www.mypage.com/test

should be automatically redirected to

www.mypage.com/index.php?/test.html

what i already did is:
- creating the directory called "test"
- creating a index.html, which i put in this directory

then i tried the meta- and the javascript-redirection, but both redirects delivered the startpage of s9y instead of the page mentioned above.

i read in the forums that there is also the possiblity of redirecting with htaccess-files, but this seems to be a bit difficult and i am not sure if it would solve my problem.

does anybody know what could help?

Re: redirect from directory to static page

Posted: Mon Mar 05, 2007 4:55 pm
by garvinhicking
Hi!

How does your .htaccess file currently look like?

If "index.html" should be opened when you call "/test" you must make sure that DirectoryIndex "index.html" is set in a .htaccess of the 'test' subdirectory.

HTH,
Garvin

Posted: Mon Mar 05, 2007 7:43 pm
by proberlin
hi garvin,

that is what my htaccess in the root directory looks like at the moment:

# BEGIN s9y
DirectoryIndex /index.php

<Files *.tpl.php>
deny from all
</Files>

<Files *.tpl>
deny from all
</Files>

<Files *.sql>
deny from all
</Files>

<Files *.inc.php>
deny from all
</Files>

<Files *.db>
deny from all
</Files>

# END s9y

what i did now is to create a separate htaccess-file, that looks like this:

# BEGIN s9y
DirectoryIndex /index.html

# END s9y

i put that file in the test-directory, but when i want to open that directory now, an error occurs "access denied"...

Posted: Mon Mar 05, 2007 8:06 pm
by garvinhicking
Hi!

Use

DirectoryIndex index.html

so, remove that leading "/" in the subfolder's .htaccess. :-)

HTH,
Garvin

Posted: Mon Mar 05, 2007 10:32 pm
by proberlin
hi garvin,

thanks a lot! now it works perfectly.