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…