BW: Boltwire Projects > Tips and Tricks

Tips and Tricks

.htaccess tips

Controlling BW while using ClearURL's is done via a configuration change and also by settings in your .htaccess file.

The .htaccess file starts off with a section like:

AddDefaultCharset UTF-8

RewriteEngine On
Options FollowSymlinks
RewriteBase /

First line tells Apache to send a Default Character type of UTF-8.

The next couple lines make sure the rewrite engine is on, option to follow symbolic links and sets the base rewrite address.

I then follow this up with redirects for old content that I want to be redirected to where the new content is for important pages.

RewriteRule ^webtools.php$ http://www.tnet.com/services/webtools [NC,R=301,L]

Each is a rule onto itself. Basically, it is saying that if the local page on the left is tried, we want to rewrite it to the page on the right.

So....

http://www.tnet.com/webtools.php

gets redirected to

http://www.tnet.com/webtools

and provide a return code of 301 indicating this is a change. This is important to maintain search engine results that have built up over the years and keep them valid as the same content is moved from one format to another.

Next is a section of excludes to prevent the pages from being seen as possible Wiki pages...

Individual files are listed like:

RewriteCond %{THE_REQUEST} !/robots.txt

Where whole directories are listed like:

RewriteCond %{THE_REQUEST} !/FiLeS/(.*)\.

Lastly, are the redirects that deal with the Wiki pages themselves:

RewriteCond %{THE_REQUEST} !/home/files/(.*)\.
RewriteCond %{THE_REQUEST} !/boltwire/farm/img/(.*)\.
RewriteRule ^(.*)$ home/index.php?p=$1 [QSA,L]

I also have below that a redirect for invalid pages:

ErrorDocument 401 /errorpage401
ErrorDocument 403 /errorpage403
ErrorDocument 404 /errorpage404

These point to wiki pages that provide info when they are hit.

Headers

Headers allow you to place extra content at the top of pages. If you create a header on an hierarchy like somepages.header then all the pages in the somepages group will use that header.

You can limit the use of the header on the first page with code like:

[if ! equal {p0} 1]<right>>>[[membership|**Return to Membership Page**]]>></right><br>[if]

Change servers CharSet

In the root level .htaccess file for a website, add the following and you will change the default CharSet for all pages.

AddDefaultCharset UTF-8

This works for Apache webservers.

Change Editor width

This one took me a while to find. You need to change the action.edit page and change the cols in the textbox on that page. Original is 60 cols, I used 80 when the wiki was formatted for 950px... Now that it is thinner at 900px, I changed it to 70.


Community Name and Slogan

When I first started out, I couldn't figure out where these were stored. You would think it would be in site.config but it is not. It is instead found in code.snippets. You might look for:


Shortcut when adding links

The code {p} allows you to reference the current page. So if you are adding links and you are deep into a page structure, you can use that code to shortcut the links.

Example

If you were on a page like document.website and wanted to add links to pages for config, virtualhosts etc... you could use this like:
* [[{p}.config|Config]]
* [[{p}.vhosts|VirtualHosts]]

Which would be the same as using:

* [[document.website.config|Config]]
* [[document.website.vhosts|VirtualHosts]]

You can also use:

* [[...config|Config]]
* [[...vhosts|VirtualHosts]]

Form Processed Messages

By default, this is in the main page area. It is controlled by the command: <div class='message'>Form submitted. Preview Mode.</div>.

You can move it to the side zone.. You can change it so that only an admin sees it like.

[if admin]<div class='message'>Form submitted. Preview Mode.</div>[if]

If you move it to the side, you might want to add CSS to control for it like:

#side .message {
    background-color: #f7f7f7;
    padding: 7px;
    margin: 15px 0px 7px 0px;
    border: 1px solid #999;
    color: green;
    font-size: 80%;
    word-wrap: break-word;
}

The word-wrap: break-word; actually causes the message to split without overrunning the box into the main if you move it to the side zone.

Main Sections:

Other TNET Sites:


Contents © 2010 TNET Services, Inc. - All rights reserved.
You are a member of the guest groups
Page Creation by TNET using Boltwire v3.4.11 Hosting by TNET - Server Temps (189F/167F/104.4F)
IP: 38.107.191.104 [No rDNS] - Views #9