WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pretty Permalinks in Lighthttpd (3 posts)

  1. skycrew
    Member
    Posted 6 years ago #

    Hi,

    I have 2 blog running in one domain.

    1) http://www.domain.net/blog/
    2) subdomain.domain.net

    before this, Im using Apache

    this are the mod rewrite for 1st blog in apache:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>

    and this are the mod rewrite for the 2nd blog:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    after I change my shared hosting to VPS, I only can use lighthttpd. So I google about this and find this code:

    url.rewrite-once = (
    “^/(wp-. ).*/?” => “$0″,
    “^/(sitemap.xml)” => “$0″,
    “^/(xmlrpc.php)” => “$0″,
    “^/keyword/([A-Za-z_0-9-] )/?$” => “/index.php?keyword=$1″,
    “^/.*?(?.*)?$” => “/index.php$1″
    )

    the code works great for the 2nd blog, but not for my 1st blog. I can access http://www.domain.net but if I click hyperlink to http://www.domain.net/blog I will get 404 error.

    anyone can help me??

  2. skycrew
    Member
    Posted 6 years ago #

    no help for this?

  3. svemir
    Member
    Posted 5 years ago #

    And for your first blog, you need to specify the folder name - something like:

    $HTTP["host"] =~ "www.domain.net" {
    url.rewrite-once = (
    "^/blog/(wp-|sitemap\.xml|xmlrpc\.php).*/?" => "$0",
    "^/blog/keyword/(\w+)/*$" => "/feedback/index.php?keyword=$1",
    "^/blog/" => "/feedback/index.php"
    )
    }

    The first one may continue to work, but you should probably limit it to the subdomain:

    $HTTP["host"] =~ "subdomain.domain.net" {
    url.rewrite-once = (...)
    }

Topic Closed

This topic has been closed to new replies.

About this Topic