redirect from directory to static page

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
proberlin
Regular
Posts: 23
Joined: Wed Aug 02, 2006 8:59 pm
Location: Berlin, Germany

redirect from directory to static page

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: redirect from directory to static page

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
proberlin
Regular
Posts: 23
Joined: Wed Aug 02, 2006 8:59 pm
Location: Berlin, Germany

Post 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"...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Use

DirectoryIndex index.html

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

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
proberlin
Regular
Posts: 23
Joined: Wed Aug 02, 2006 8:59 pm
Location: Berlin, Germany

Post by proberlin »

hi garvin,

thanks a lot! now it works perfectly.
Post Reply