Forum Moderators: phranque
[mysite.com...] (index page)
written as
[mysite.com...]
Here is what I currently have in my .htaccess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files><Files "common.php">
Order Allow,Deny
Deny from All
</Files>
<files .htaccess>
order allow,deny
deny from all
</files>
DirectoryIndex portal.php index.php index.html index.htm
RewriteEngine on
RewriteBase /
RewriteRule ^index\.(htm¦html¦php) http://mysite.com [R=301,L]
RewriteRule ^(.*)/portal\.(htm¦html¦php) http://mysite.com/$1/ [R=301,L]
I am trying to rewrite the following and having issues accomplishing it
[mysite.com...] (index page)
written as
[mysite.com...]This isn't clear, especially the "written as" part.
In order to help you find a working solution to the right problem, we need to know:
What "index page" URL do you link to on your pages?
Which "index page" filepaths exist, and what is the URL used to access them?
How did you test?
What were the results?
How did the actual test results differ from those you expected?Jim
My webserver is set up as web5/web/phpBB3/...
If I place an indel.html file into the web folder I will get that when i type in mysite.com in my address bar
When i replace the index.html file in the web folder with my .htaccess file and I type in mysite.com in the address bar i get the unformated page of the portal.php
Here is the current .htaccess file I am using
<Files "config.php">
Order Allow,Deny
Deny from All
</Files><Files "common.php">
Order Allow,Deny
Deny from All
</Files>
DirectoryIndex phpBB3/portal.php index.php index.html index.htm
Because the URL and the filepath are different, you will probably need to link to them using a server-relative URL-path or a canonical URL, and not with a page-relative URL-path. That is, use <link rel="stylesheet" type="text/css" href="/path-to-stylesheet.css"> or <link rel="stylesheet" type="text/css" href="http://example.com/path-to-stylesheet.css">, and not <link rel="stylesheet" type="text/css" href="path-to-stylesheet.css">
Other than that, I suppose you could just rewrite *all* URL-requests to the /phpBB3 subdirectory, but then one has to ask, why not simply install the board in the root directory to begin with?
To rewrite all requests, you'll need something like this:
RewriteCond $1 !^phpBB3/
RewriteRule ^(.*)$ /phpBB3/$1 [L]
If you use this rule, I think you'll need to change DirectoryIndex to "portal.php".
You may wish to exclude certain other paths from being rewritten. For example, if robots.txt is located in the top-level directory, and you don't want to move it to the/phpBB3 subdirectory, you'd need to add an exclusion for it:
RewriteCond $1 !^robots\.txt$
Jim
To be clear, URLs are created and defined in the HTML of Web pages. They "exist" as soon as you refer to them in the HTML of a published page. This is regardless of whether they will actually resolve to a resource on a server somewhere if they are "followed" or "clicked."
Jim
Jim