Any Apache server gurus here? help! .htaccess rewriterules

I’m trying to get a CMS up and running on my website - one of the options in the CMS is ‘static links’ - meaning in this context that URLS can be expressed in friendly form, i.e.:
http://atomicshrimp.com/st/content/foo
as opposed to the actual path to the content, which would be:
Atomic Shrimp

The CMS achieves this by automatically generating an .htaccess file containing a bunch of rewriterule lines, it looks like this:


RewriteEngine On
RewriteRule ^st/commsfeed/([^/]+)/([^/]+)/([^/]+)/?$ commsrss.php?p=$1&$2=$3 [NC] 
RewriteRule ^st/commsfeed/([^/]+)/?$ commsrss.php?p=$1 [NC] 
RewriteRule ^st/commsfeed/?$ commsrss.php [NC] 
RewriteRule ^st/feed/([^/]+)/([^/]+)/([^/]+)/?$ rss.php?p=$1&$2=$3 [NC] 
RewriteRule ^st/feed/([^/]+)/?$ rss.php?p=$1 [NC] 
RewriteRule ^st/feed/?$ rss.php [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/print/?$ index.php?s=$1&p=$2&$3=$4&$5=$6&$7=$8&print=1 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ index.php?s=$1&p=$2&$3=$4&$5=$6&$7=$8 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/print/?$ index.php?s=$1&p=$2&$3=$4&$5=$6&print=1 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ index.php?s=$1&p=$2&$3=$4&$5=$6 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/print/?$ index.php?s=$1&p=$2&$3=$4&print=1 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ index.php?s=$1&p=$2&$3=$4 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/print/?$ index.php?s=$1&p=$2&print=1 [NC] 
RewriteRule ^st/([^/]+)/([^/]+)/?$ index.php?s=$1&p=$2 [L,NC] 

Now, I know next to nothing about the syntax of these (is it regular expressions?), but I think I understand the last line as being the one that should shuffle things around so as to ppoint friendly-format URLS at index.php with the right variables to get the content.

So anyway… it just doesn’t work. My web hosting package is definitely running Apache and the hosting company assures me that I am permitted to use the rewrite engine, furthermore, I know the .htaccess file isn’t just being ignored, because I pasted in an ErrorDocument 404 line and it does indeed redirect 404 errors to my custom page.

But the rewrite business just isn’t working.

I contacted my host’s support centre and they came back with:

But that sounds more like he’s just pasting an example out of a manual - does that expression do anything like the rewrite I’m trying to do here?

Help!. I’m floundering - I’ve posted a request at the CMS author’s forum too, but no response yet…

Sussed it. Apparently the .htaccess file needs:

Rewritebase /

As the second line.

Site is now up and running! Yay!

I must commend you on your work. You’ve done well.

Now all you need to do is use Firefox with the HTML Validator addon installed and you can address the 16 problems found on your home page. :smiley:

It never ends…

I have the validator as part of the web developer toolbar. Fixing the first few errors made more apparent - the count is now up to 26. Mostly missing alt tags.

Oh well - that’s this evening’s work cut out…

I was going to make this comment in one of your earlier threads, but i forgot.

I think your layout is generally nice, but i really think that your central content area (.maincolumn) needs more right padding in order to separate it from the right hand section (.sidecolumn).

As it is now, the text from the main column runs right up near the border of the side column, and makes the page look too messy. I think that changing the padding-right attribute of the main column from 5px to 20 or 30 pixels makes the whole page look neater and easier on the eye. I also think it wouldn’t hurt to add about 5-10 pixels of left padding as well, just so you’ve got a little bit of white space on each side of your main content.

Just MHO.

Thanks. I had been holding back from doing that, but only really because of the size of some of the images I’ve floated left in the main column of some pages (such as this one. But you’re right - it does feel too busy. The solution, I think, is to do as you say and then just use smaller images, or if big ones are necessary, not attempt to put text alongside them.

That definitely helped, I think. In fact, I think the right edge of the text in the main column was previously constrained not by the padding, but by the margin of the side column - because on pages where the main column was longer than the side one, the text would ‘pop’ out a few more pixels when it got past the side column. It’s not doing that now that I’ve increased the padding.

Yeah, that looks considerably neater now, and the whole page resizes very nicely when you resize the browser window.