Forum Replies Created

Viewing 15 replies - 1 through 15 (of 42 total)
  • cheese500

    (@cduke250)

    Should work now.. an ongoing process.

    cheese500

    (@cduke250)

    That is incorrect. It is impossible for this plugin to replace your 404.php, here is the code to prove it.

    function aa_google_404_activate(){
    	global $aa_G404;
    
    	if ( !file_exists(TEMPLATEPATH.'/404.php')){
    		if (!copy(dirname(__FILE__).'/404.php', TEMPLATEPATH.'/404.php'))$aa_status.='<div id="message" class="error fade"><p><strong>ERROR:</strong>Attempt to create 404.php FAILED!</p></div>';
    		else $aa_status.='<div id="message" class="updated fade"><p><strong>Message:</strong>Attempt to create 404.php SUCCESS!</p></div>';
    	}else {
    		$the_404_data = implode( '', file( TEMPLATEPATH.'/404.php' ));
    		if (false!==($aa_temp=strpos($the_404_data,'AskApache'))){
    			unlink(TEMPLATEPATH.'/404.php');
    			if (!copy(dirname(__FILE__).'/404.php', TEMPLATEPATH.'/404.php'))$aa_status.='<div id="message" class="error fade"><p><strong>ERROR:</strong>Attempt to create 404.php FAILED!</p></div>';
    			else $aa_status.='<div id="message" class="updated fade"><p><strong>Message:</strong>Attempt to create 404.php SUCCESS!</p></div>';
    		}
    	}

    What most likely happened is that your blog was using your basic index.php for your theme because you didn’t have a 404.php file in your templates folder.

    Sorry for the confusion, the next version will make this optional.

    yes the way it works is you type in the username and password the first time you try to access anything in wp-admin/, if you type the right password it gets saved in your browser and is automatically sent in your HTTP headers for every request within the /wp-admin/ realm.

    This is one of the oldest most widely supported basic means of auth no the net, the plugin is minimal for now.

    PHP5 is soo much better btw!

    Depending on how many user accounts you have .htaccess would be an ideal solution because it runs on the server and is supported by all clients, even mobiles.

    This
    htpasswd plugin
    is still beta but it will be able to use wordpress login information automatically.

    But I do believe you can use .htaccess to accomplish that today if you want. I would recommend this.

    1. deny access to all files except the login page
    2. redirect all 403 denied to login page
    3. then allow access from all users that successfully log in by checking for the present of a cookie using mod_rewrite

    Hey wait thats a good idea!

    Working on it….

    What does the RewriteRules / Permalinks Debugger Plugin tell you?

    try chmodding your /.htaccess to 644 and updating your permalinks..

    try adding this to your .htaccess

    DirectoryIndex /index.php
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    Whiteshadow thanks! I just implemented your suggestion and it works great, nice one.

    AskApache What Is This Plugin – Version 2.3

    I rely on mysql backups.. this happens alot for strange reasons.

    You could try re-running the upgrade script.. disabling permalinks and then re-enabling them, this is difficult if you don’t have backups.

    I use a shell script to make a sql backup before EVERY change I make to my blog..

    Forum: Plugins
    In reply to: organising plugins

    I copied the basic idea from the Google Sitemap Generator plugin.. glad you appreciate it, it makes it easier to develop plugins also.

    Check out the post on askapache Tips on Writing WordPress Plugins for some good info.

    Thread Starter cheese500

    (@cduke250)

    Ya you need to delete the /wp-admin/.htaccess file..

    I got really excited about it and ended up writing the whole thing in a couple hours, then I was exhausted but I submitted the dang thing anyways.. I’m working it on it now though and the next update will be legit. There was a ton of stuff to improve but WordPress’s Plugin API makes it alot of fun to program.

    I had this exact same problem as well… I lived on backups for a couple months and couldn’t get it to work.

    Then I did some hacking and figured it out. First I added the plugin:

    function fix_slash($string, $type) {
      global $wp_rewrite;
      if ($wp_rewrite->use_trailing_slashes==false && $type != 'single')
        return trailingslashit($string);
      return $string;
    }
    
    add_filter('user_trailingslashit', 'fix_slash', 66, 2 );

    that is a bit of a custom job from this forum, but it works at adding a trailing slash to links…

    Now whenever I want to edit a page I backup my sql, then I have to go edit /wp-includes/rewrite.php specifically

    function get_category_permastruct() {
    		if (isset($this->category_structure)) {
    			return $this->category_structure;
    		}
    
    		if (empty($this->permalink_structure)) {
    			$this->category_structure = '';
    			return false;
    		}
    
    		//if (empty($this->category_base))
    			//$this->category_structure = $this->front . 'category/';
    		//else
    			$this->category_structure = '/';
    
    		$this->category_structure .= '%category%';
    
    		return $this->category_structure;
    	}

    I just have to uncomment those 3 lines and it works perfect. BTW, I recommend DreamHost

    Forum: Fixing WordPress
    In reply to: robots.txt

    That is more of a learning example to show what is possible and how it works. Check out the Updated robots.txt ffor WordPress.

    User-agent: *
    Disallow: /cgi-bin/
    Disallow: /wp-admin/
    Disallow: /wp-includes/
    Disallow: /wp-content/plugins/
    Disallow: /wp-content/cache/
    Disallow: /wp-content/themes/askapache/
    Disallow: /trackback/
    Disallow: /2006/
    Disallow: /2007/
    Disallow: */trackback/
    Disallow: */feed/
    
    User-agent: Googlebot
    Allow: /wp-content/uploads/
    
    User-agent: Googlebot-Image
    Disallow:
    Allow: /*
    
    User-agent: Mediapartners-Google*
    Disallow:
    Allow: /*
    
    User-agent: ia_archiver
    Disallow: /
    
    User-agent: duggmirror
    Disallow: /
    
    # Does anyone care I love Google Apache htaccess
    
    Sitemap: https://www.askapache.com/sitemap.xml

    Ok I’m definately a newbie with WP’s code, but i’m getting the impression that their is some incorrect logic going on.. specifically in regards to the user_trailingslashit function.. I’m thinking that because some of us have permalinks that end in postname.html maybe that is causing the missing trailing slash problem…

    I was able to remove the /category/ base real easy, but what I can’t do is get the trailing slash to show up.. Oh well I don’t really use pages anyway. And I don’t recommend using the mod_rewrite code I posted earlier that adds the trailing slash, because it just hides the problem from you, search engines and source code still have bad links, its an internal problem I would guess. Again I really should mention I don’t really know what I’m doing with WP so you should probably just wait until they fix the bugs themselves.

    You can surf my blog to get a feel for what is working @askapache.com

    To remove the category base edit the get_category_permastruct function in /wp-includes/rewrite.php

    function get_category_permastruct() {
    		if (isset($this->category_structure)) {
    			return $this->category_structure;
    		}
    
    		if (empty($this->permalink_structure)) {
    			$this->category_structure = '';
    			return false;
    		}
    
    		if (empty($this->category_base))
    			$this->category_structure = $this->front . 'category/';
    		else
    			$this->category_structure = $this->category_base . '/';
    
    		$this->category_structure .= '%category%';
    
    		return $this->category_structure;
    	}

    From:

    if (empty($this->category_base))
    			$this->category_structure = $this->front . 'category/';
    		else
    			$this->category_structure = $this->category_base . '/';

    to:

    //if (empty($this->category_base))
    		//	$this->category_structure = $this->front . 'category/';
    		//else
    			$this->category_structure = '/';

    And of course you have to do modify the category-template.php as per the instructions in my previous post.

    Ok I figured out another way to fix this… but this is a hack of the wp code so its risky (it works though).

    Edit the function get_category_link in the file /wp-includes/category-template.php

    function get_category_link($category_id) {
    	global $wp_rewrite;
    	$catlink = $wp_rewrite->get_category_permastruct();
    
    	if ( empty($catlink) ) {
    		$file = get_option('home') . '/';
    		$catlink = $file . '?cat=' . $category_id;
    	} else {
    		$category = &get_category($category_id);
    		$category_nicename = $category->category_nicename;
    
    		if ( $parent = $category->category_parent )
    			$category_nicename = get_category_parents($parent, false, '/', true) . $category_nicename;
    
    		$catlink = str_replace('%category%', $category_nicename, $catlink);
    		$catlink = get_option('home') . user_trailingslashit($catlink, 'category');
    	}
    	return apply_filters('category_link', $catlink, $category_id);
    }

    Change
    $catlink = get_option('home') . user_trailingslashit($catlink, 'category');
    to
    $catlink = get_option('home') . user_trailingslashit($catlink, 'category') . '/';

    Options +FollowSymLinks
    
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_URI} ^[^\.]+[^/]$
    RewriteRule ^(.*)$ https://www.askapache.com/$1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    Works for me.

Viewing 15 replies - 1 through 15 (of 42 total)