homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

This 35 message thread spans 2 pages: < < 35 ( 1 [2]     
Redirect pages.

Msg#: 4268723 posted 10:49 pm on Feb 17, 2011 (gmt 0)

Ok so i have a phpbb forum with a portal mod ...

im using this for a while to redirect from the main domain (ex. example.com)to the Forums folder

Redirect 301 /index.php http://www.example.COM/Forums

but i dont want the domain to link to the index anymore ..

i want to link the domain to /Forums/portal.php
and not /Forums/index.php as the code above dos ...

i tried to change the index with the portal like this :
Redirect 301 /portal.php http://www.example.COM/Forums

but it gives me a 404 error.. any idea whats up?

Also i would like some fix for caps on folders ..

im on a Linux system and if i have a folder called Forums it gives me a error if i try browsing to forums(no caps on F)



Msg#: 4268723 posted 12:14 am on Apr 8, 2011 (gmt 0)


i though i said that i tried them all and they dont work ...


RewriteRule ^index\.php /Forums/portal.php [L]

RewriteRule ^$ /Forums/portal.php [L]

The First example gives me a 404 error (maybe because theres no index.php in the root O-o)

The Second/Middle example makes the page look the same as if i Add DirectoryIndex /Forums/portal.php
So thats not what i need...


WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4268723 posted 12:20 am on Apr 8, 2011 (gmt 0)

1. You request example.com/index.php and the rewrite fetches the file at /Forums/portal.php and it is irrelevant if there is an index.php file inside the server as it will never be served.

2. You request example.com/ and the rewrite fetches the file at /Forums/portal.php but you now say that isn't what you want. I am confused.


Msg#: 4268723 posted 5:41 pm on Apr 11, 2011 (gmt 0)

Friend ..
If we do a rewrite that gets the page from /Forums/portal.php on the root the page is broken because the paths to images and css files etc arent loaded ...

the reason is that phpbb uses a path system like : {T_TEMPLATE_PATH}/Bookmark.js {T_STYLESHEET_LINK} etc.......
So it has to have Forums into the stylesheet path...
If i just do a rewrite it will serve the portal page but not the right paths to the files..
i aleady said that somewhere above

Sorry for my silly way of explaining .. i hope you get me :)


WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4268723 posted 10:36 pm on Apr 14, 2011 (gmt 0)

This thread is too long. You're asking us to write your code for you, and we cannot do that here. Please put some effort into understanding the basic concepts already pointed out several times above, and then go spend a week studying the mod_rewrite documentation and experimenting to confirm that you're understanding the concepts. Spending that week will be a huge time-saver for you over the long term. It's either spend time or money...

We don't write code on request here because there are far too many such requests, the result is (possibly) a working solution of which the webmaster has no understanding (and thus returns again and again for "just one more small change"), and possibly --due to our misunderstanding or not being aware of the full scope of the site, its URL-space, and its filepaths-- a "fatal" SEO-related error that will cause the site to tank in the search engines.

Therefore, it is incumbent on all requestors to write their own code, test it, and then we can help with specific and well-described problems. That is the "directive" that was given for the creation of this forum as described in our Charter document, and as no-one is getting paid for (often lengthy) contributions here, it is both reasonable and fair.

Your problem with templates and css and image files (as well as any .js script references) can likely be solved by excluding those filetypes from the page rewrites we've discussed above, or by applying different rewrites to the URLs for those objects. Linking to included-object URLs which are root-relative or absolute is usually sufficient to solve this problem (your pages must link to "/image.logo.gif" or to "http://example.com/image/logo.gif", and not to "image/logo.gif"). If that doesn't work, then the problem is that your CMS is insufficiently flexible for the environment you intend to use it in, so that either your intended environment must change or the CMS code must change. That's just the way it is, and there's not much anyone can do about it.



Msg#: 4268723 posted 12:40 pm on Apr 26, 2011 (gmt 0)

I Have fixed my issue. There was nothing Apache related it seems.and it was more simple than i though....

this piece of script into the root did the work

define('PHPBB_ROOT_PATH', './Forums/'); //Change forum to the correct path
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include(PHPBB_ROOT_PATH . 'portal.' . $phpEx);

If you would have been willing to help you could have wroten a few lines of code... :P

This 35 message thread spans 2 pages: < < 35 ( 1 [2]
Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved