[Tuts Worldpress] Làm link thân thiện (Frendly Link) (Permalinks) trong Worldpress

administrator

Administrator
Staff member
Tú cũng chẳng thích và cũng chẳng có trình gì để có thể viết nổi Tut, nhưng hôm nay mạn phép chia sẻ thêm vs mọi ng 1 cách và kinh nghiệm trong việc làm đẹp cái link trong blog của bạn.

Tại sao phải cần Link thân thiện: Điều này giúp tối đa hóa hiệu quả của web,giúp nó seo tốt hơn. Nếu bạn muốn phát triển web thì đây là 1 việc ko thể thiếu.

Ban đầu: http://2prosoft.com/?p=123
Hoàn thành: http://2prosoft.com/video-graphics/31adobe-photoshop-cs3-full-setup-full-link-mediafire-good.html

Bạn vào Admin của Worldpress, vào Setting --> Permalink --> Tại mục Permalink Settings bạn chọn như sau:


Bạn chọn vào nút: Custom Structure và cấu hình như sau: /%category%/%postname%.html

Bảng thuộc tính của nó:
%year%
The year of the post, four digits, for example 2004

%monthnum%
Month of the year, for example 05

%day%
Day of the month, for example 28

%hour%
Hour of the day, for example 15

%minute%
Minute of the hour, for example 43

%second%
Second of the minute, for example 33

%post_id%
The unique ID # of the post, for example 423

%postname%
A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI.

%category%
A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.

%author%
A sanitized version of the author name.
Bạn tham khảo thêm tại đây.


Tạo File .htacess và Upload nó lên ngang hàng với thư mục Root của Web (Chỉ áp dụng với hosting sử dụng hệ điều hành Linux và Unix. Riêng Windows server thì ko áp dụng đc cách này


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Mình cũng thử tìm plugin để hỗ trợ rewrite nhưng ko tìm đc cái nào phù hợp, và cách này cũng đơn giản mà hiệu quả, đc khuyến khích bởi google và worldpress.

Chỉ 2 bước đơn giản vậy là xong, link đã đẹp như thường, chúc các bạn cấu hình đc link thật đẹp và phát triển website tốt.

Caotu (TTDA)
 
Bên trên