Forum Moderators: phranque

Message Too Old, No Replies

htaccess

path forwarding

         

Bobin_59

6:50 am on Oct 12, 2007 (gmt 0)

10+ Year Member



my forum software is installed in a root's subfolder. the question is how can I make my url starting in that folder?

In other words, typing forum.mydomain.com should actually start as forum.mydomain.com/sub-folder/index.php

I tried 'DirectoryIndex /sub-folder/index.php' and the page loads but without any graphics.

how can I make it work?

phranque

10:52 am on Oct 12, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Bobin_59!

how are you referring to urls in the image tag source attribute values?
are they absolute or relative?
have you checked the access logs to see what urls are being requested?
perhaps you can fix the image file urls so that thet are correct, move/copy the image files so that they are in the referred location, or internally rewrite the incoming image file requests to the correct location.

Bobin_59

10:59 pm on Oct 12, 2007 (gmt 0)

10+ Year Member




Thanks for the welcome!
My time zone is Australia - sorry for the late reply! :)
I am using the phpbb forum software - no idea about its internals.

[edited by: Bobin_59 at 11:00 pm (utc) on Oct. 12, 2007]

g1smd

12:42 am on Oct 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Be aware that relative URLs are evaluated by the browser using the URL seen in the browser URL bar as the root.

Bobin_59

2:01 am on Oct 13, 2007 (gmt 0)

10+ Year Member



what I actually want is my sub domain:
forum.domain.com

to start

forum.domain.com/subdir/index.php (which works properly)

I just need the code for htaccess to do that :)

I tried:
DirectoryIndex subdir/index.php

and the page starts but not all front page (phpbb forum) images are displayed

subdomain redirection in my cPanel is not working properly so it's of no help here.

ideas?

[edited by: Bobin_59 at 2:03 am (utc) on Oct. 13, 2007]

jdMorgan

2:21 am on Oct 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



phranque's diagnosis of the problem still applies. In order to fix it, you need to change the links produced by PHPbb from page-relative to server-relative or absolute. That's really the only way to fix the broken image link problem.

Jim

Bobin_59

2:30 am on Oct 13, 2007 (gmt 0)

10+ Year Member



Ok, how/where can I do that? I am totally noob to that forum software :/

phranque

4:39 am on Oct 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i would start with what your browser sees.
right click, view source.
figure out what type of urls are provided in the image tags.
then it's a matter of figuring out if you can fix it with installation or configuration or if you actually have to tweak some templates or some data.
these type of specific install/config questions would probably get better or at least faster answers in the phpbb support forum [phpbb.com] than here.

Bobin_59

6:09 am on Oct 13, 2007 (gmt 0)

10+ Year Member



Ok, the source code shows absolute paths to images like:
src="templates/subSilver/images/folder_big.gif"

would it not be waay easier to create a htaccess that sets your homedir correctly?

when I point my browser to:
forum.domain.com/sub-dir/index.php

then all is working fine. The only question is how can I transfer anyone who types forum.domain.com into the URL box to the sub-dir and all would be well without fiddling with any templates?

I was under the impression it's an easy task to "redirect" visitors but it seems easier to delete everything and install the forum in the sub-domain's root folder?

[edited by: Bobin_59 at 6:11 am (utc) on Oct. 13, 2007]

Bobin_59

7:39 am on Oct 13, 2007 (gmt 0)

10+ Year Member



installed the forum in the root and all is fine now!
thanks for trying hard...

phranque

9:16 am on Oct 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Ok, the source code shows absolute paths to images like:
src="templates/subSilver/images/folder_big.gif"

that would be a relative path.
an absolute path includes the root directory (of the server in this case) which means it would start with a "/".