• Resolved skycrew

    (@skycrew)


    Hi,

    I have 2 blog running in one domain.

    1) https://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 https://www.domain.net but if I click hyperlink to https://www.domain.net/blog I will get 404 error.

    anyone can help me??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter skycrew

    (@skycrew)

    no help for this?

    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 = (...)
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pretty Permalinks in Lighthttpd’ is closed to new replies.