// site values
$phpwcms['site'] = 'http://'.$_SERVER['SERVER_NAME'].'/';
// paths
$phpwcms['DOC_ROOT'] = $_SERVER['DOCUMENT_ROOT'];
$phpwcms['root'] = 'wcms'; //default: ''
\\
=== Solution 1: ===
**http://example.com/.htaccess**
RewriteEngine on
RewriteRule ^(.*) http://example.com/wcms/ [R,L]
\\
=== Solution 2: ===
**http://example.com/index.php**
\\
===== Forwarding with error 404: =====
If a requested page does not exist, it is often desired that a custom error page is produced with custom layout. \\
Under normal conditions the given layout of the page "home" was delivered with the error message of the range "error".
If we write in the "error" area in the template for "home" the following redirect, an error page with a separate layout can be created. \\
This error page lies typically in a hidden range of the system //(ADMIN -> site structure -> frontend menu status: [x] hide)//.
**http://example.com/index.php?404**
\\
----
Docu: -- \\
Forum: [[http://forum.phpwcms.org/viewtopic.php?p=126314#p126314|mod_rewrite + RewriteRule + errorDocument]]
**Author:** Heiko H. \\
**CMS Version:** >= 1.26 \\
**Version:** V1.0 \\
Tag: -- \\
fileiname: -- \\
Folder: --
**Condition:** -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\
* ##$phpwcms['allow_ext_render'] = 1;##
----
----
\\
[PHP]
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://example.com/index.php?404" );
exit;
[/PHP]
\\
===== Forwarding with error 404 (second try): =====
Another attempt for dealing with "not found" or "moved elswhere".
See forum: http://forum.phpwcms.org/viewtopic.php?p=127140#p127140
==== Set up a (potentially global) 404 file ====
Create a file "moved.php" with the following content (or as you like) and throw it somwhere ;) (your php root will be best for testing purposes, but it could be anywhere):
Content not found or moved elsewhere
The requested page could not be found or doesn't exist any longer! Please excuse the inconvenience!
Obviously your bookmarks are a little bit outdated. Please follow the link we have provided for you beneath:
Die angefragte Seite konnte nicht gefunden werden! Entschuldigen Sie bitte diese Unannehmlichkeit!
Offensichtlich haben Sie noch einige veraltete Bookmarks gespeichert. Bitte benutzen Sie den folgenden Link, um zu unserer neuen Seite zu gelangen:
mysupidupidomain.tldmyothersuper.tld1, anothersupertotal.tld2
==== We need some frontend_init-script ====
This will become a frontend_init script. Call it 404_forwarding.php and throw it into /template/inc_script/frontend_init/
==== What does this script do? ====
It will check if a queried page is existing within your system. Perhaps you did change an alias some while ago and now the bookmarks of your friends are going wonk. phpwcms' frontent_init-script will now take over and call a little page you've set up already, I bet. No?
==== Create your error article ====
So go ahead and create a new page (article) with an excusion for the worries, a search mask and whatever you like - it's your own phpwcms 404 error page ;) . Don't forget to save it into a hidden category (frontend menu status checked to [x]hide). This way the error page doesn't belong anywhere and can't mislead anybody.
==== Edit your 404_forwarding.php ====
Check the article id of your newly created article (you know how to do that), edit 404_forwarding.php and enter it instead of that 1255 (because this ArticleID from further above is just an example, not more) to reflect your special article ID.
If somebody tries to search your phpwcms installation by using directory structures like domain.tld/heavy/ the script is passing the force over to moved.php.
==== It's for a multidomain setup too ====
But this is another story.