Home > PHP, Smarty, Thiết kế Web > llighttpd rewrite wordpress blog

llighttpd rewrite wordpress blog

Rewrite wordpress blog trên server lighttpd

Bước 1:

# root command line
# cd /etc/lighttpd/
# vi myweb-rewrite.conf //tạo file rewrite riêng cho trang web có tên mà myweb
server.document-root = "/home/www/lighttpd/myweb"
server.error-handler-404 = "/index.php"
index-file.names = ("index.html", "index.php")
url.rewrite-once = (
    "^/(.*/)?files/$" => "/index.php",
    "^/(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2",
    "^(/wp-admin/.*)" => "$1",
    "^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
    "^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "/$2",

// Sau đó lưu lại (save) tạo folder /etc/lighttpd/

Bước 2:

– Mở lihgttpd config

# vi lighttpd.conf
$HTTP["host"] =~ "^(www\.)?myweb.com$" {
    simple-vhost.default-host = "www.myweb.com"
    include "myweb-rewrite.conf"

:wq // lưu lại
restart lại lighttpd là OK //service lighttpd restart
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: