chris_number2
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Cruft-free URIs without mod_rewrite?No, it’s not.
Change the “blog” references in the .htaccess and permalink to whatever you named the file that you created.
For example, if you created a file called “archives” (no file extension, remember!), your .htaccess would look like this:
<FilesMatch "^archives$">
ForceType application/x-httpd-php
</FilesMatch>
and so on…Forum: Fixing WordPress
In reply to: Cruft-free URIs without mod_rewrite?After a bit of hacking, I got “nice” permalinks working like so:
in wp-blog-header.php, change lines 15 – 28 or so with this:
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
$wpvar = $wpvarstoreset[$i];
if (!isset($$wpvar)) {
if (empty($HTTP_POST_VARS[$wpvar])) {
if (empty($HTTP_GET_VARS[$wpvar]) && empty($link_vars[$wpvar])) {
$$wpvar = '';
} elseif(!empty($HTTP_GET_VARS[$wpvar])) {
$$wpvar = $HTTP_GET_VARS[$wpvar];
}else{
$$wpvar = $link_vars[$wpvar];
}
} else {
$$wpvar = $HTTP_POST_VARS[$wpvar];
}
}
}
then, create a copy of index.php. Name it to whatever you want, but don’t put a file extension. I called mine “blog”.
Edit this file so these lines appear before the line thatrequire
s wp_blog_header.php:
// permalink structure: /blog/%year%/%monthnum%/%day%/%postname%/
//Get needed vars:
$temp_link_vars = explode("/",$_SERVER['PATH_INFO']);
if($temp_link_vars[1]!="category"){
$link_vars['year'] = $temp_link_vars[1];
$link_vars['monthnum'] = $temp_link_vars[2];
$link_vars['day'] = $temp_link_vars[3];
$link_vars['name'] = $temp_link_vars[4];
}else{
$link_vars['category'] = $temp_link_vars[2];
}
Add this to your .htaccess file:
<FilesMatch "^blog$">
ForceType application/x-httpd-php
</FilesMatch>
Finally, set up your permalinks like as follows:/blog/%year%/%monthnum%/%day%/%postname%/
That should work!