Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and IPB 2.1.3

Excludes directory on redirect and I don't want it to

         

mysticssjgoku4

1:44 am on Jan 4, 2006 (gmt 0)

10+ Year Member



Hello, I have a website at example.com, and I wish for my main URL to redirect to a sub-directory called RP

http://example.com/rp

Like so.

Now, in my .htaccess file I have this in it, for the main directory.

DirectoryIndex ./rp/index.php
order allow,deny
deny from 211.30.246.50
deny from 69.231.56.45
deny from 154.20.89.84
allow from all

<Files 403.shtml>
order allow,deny
allow from all
</Files>

I've tried countless variations of the DirectoryIndex, and nothing seems to work. Everytime I load my main page, for some reason, it loads the index.php, and then excludes the /rp/ directory from everything on the page and therefore my page doesn't load any images or content.

Is there any way to fix this?

Thank you.

[edited by: jdMorgan at 1:55 am (utc) on Jan. 4, 2006]
[edit reason] No URLs, please. See Terms of service. [/edit]

jdMorgan

1:54 am on Jan 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use canonical links or server-relative links on the page, and do not use page-relative links.

That is, use:
<img src="http://www.example.com/rp/my_logo.gif">
or
<img src="/rp/my_logo.gif">

and do not use

<img src="rp/my_logo.gif">

It is the browser that resolves relative links, and as far as the browser is concerned, your index page is still in your root directory.

There are other and perhaps better ways to do this, but I'm commenting on the most likely cause of the problem with the method that you are using now.

Jim

mysticssjgoku4

2:02 am on Jan 4, 2006 (gmt 0)

10+ Year Member



Well, I am using Invision Power Board 2.1.3.
For some reason, it worked when re-directing to my main index.php before, then I upgraded, now for some reason it excludes the directory.
I'm not even sure where to start.

Thanks.