Page 1 of 1

Bật Mod_rewrite trong VPSSIM

PostPosted:21 Nov 2018 21:27
by dungle79
Xin vui lòng hướng dẫn cách bật Mod_rewrite cho code của mình . Không biết thao tác thế nào trong VPSSIM

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:21 Nov 2018 22:47
by olalavui
Mod_rewrite là modules bên Apache, vpssim xài nginx

và với các rules hiện tại của vpssim chạy được đa số các sources, không biết bạn xài mã nguồn gì nhỉ?

Tốt nhất bạn cứ cài code lên, upload database, config database chuẩn thì run ngon ngay mà

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:22 Nov 2018 08:02
by nguyenoanh
Chắc bạn thấy thông báo trong plugin cache đúng không ?
Bỏ qua đi, thông báo đó dành cho apache thôi.
Quan trọng bạn cấu hình vhost chính xác cho plugin cache đang sử dụng là được.

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:22 Nov 2018 11:42
by dungle79
Nhưng khổ cái là mình xài code PHPMelody nên không chuyển sang thành URL SEO friendly được , bật chức năng đó lên là bị lỗi không chạy được clip mong muốn .
Vậy theo bạn, thì giải pháp thế nào là hiệu quả .
Mình thấy trong code đã có sẵn file ".htaccess-nginx" với nội dung như sau , nhưng sao hệ thống vẫn không xử lý được . Admin xem giúp nhé
Web: http:// mondeparfait. com
==> Nếu vậy có phải giải pháp là chạy về UBuntu không ?

"rewrite ^/index.html$ /index.php;
rewrite ^/browse.html$ /category.php;
rewrite ^/browse-(.*)-videos.html$ /category.php?cat=$1;
rewrite ^/browse-(.*)-videos-([0-9]+)-(.*).html$ /category.php?cat=$1&page=$2&sortby=$3;
rewrite ^/videos.flv(.*)$ /videos.php$1;
rewrite ^/videos.mp4(.*)$ /videos.php$1;
rewrite ^/register.html$ /register.php;
rewrite ^/contact_us.html$ /contact_us.php;
rewrite ^/edit_profile.html$ /edit_profile.php;
rewrite ^/suggest.html$ /suggest.php;
rewrite ^/upload.html$ /upload.php;
rewrite ^/upload_avatar.html$ /upload_avatar.php;
rewrite ^/suggest.html$ /suggest.php;
rewrite ^/favorites.html(.*)$ /favorites.php$1;
rewrite ^/playlists.html(.*)$ /playlists.php$1;
rewrite ^/login.html(.*)$ /login.php$1;
rewrite ^/newvideos.html(.*)$ /newvideos.php$1;
rewrite ^/topvideos.html(.*)$ /topvideos.php$1;
rewrite ^/profile.html(.*)$ /profile.php$1;
rewrite ^/user/([^/]+)/?$ /user.php?u=$1;
rewrite ^/user/([^/]+)/(.*)/?$ /user.php?u=$1&view=$2;
rewrite ^/playlist/(.*)/([^/]+)(/)?$ /watch.php?playlist=$1&vid=$2;
rewrite ^/playlist/(.*)$ /playlists.php?playlist=$1;
rewrite ^/memberlist.html(.*)$ /memberlist.php$1;
rewrite ^/articles/index-([0-9]+).html$ /article.php?page=$1;
rewrite ^/articles/browse-(.*)-([0-9]+).html$ /article.php?c=$1&page=$2;
rewrite ^/articles/tag/([^/]+)/page-([0-9]+)(/)?$ /article.php?tag=$1&page=$2;
rewrite ^/articles/tag/([^/]+)(/)?$ /article.php?tag=$1&page=1;
rewrite ^/articles/popular-([0-9]+).html$ /article.php?show=popular&page=$1;
rewrite ^/articles/(.*)_([0-9]+).html$ /article_read.php?a=$2;
rewrite ^/articles(/|.html)?$ /article.php;
rewrite ^/article(/|.html)?$ /article.php;
rewrite ^/pages/(.*).html$ /page.php?name=$1;
rewrite ^/tags/([^/]+)/$ /tag.php?t=$1&page=1;
rewrite ^/tags/([^/]+)/page-([0-9]+)(/)?$ /tag.php?t=$1&page=$2;
rewrite ^/embed/([^/]+)$ /embed.php?vid=$1;
rewrite ^/([^/]*)_([a-zA-Z0-9]{9}).html$ /watch.php?vid=$2;
rewrite ^/fpembed-(.*).swf$ /fpembed.php?vid=$1;
rewrite ^/uploads/thumbs/(.*)-social\.(jpg|gif|png)$ /social-thumb.php?vid=$1;
rewrite ^/rss.xml$ /rss.php last;
"

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:22 Nov 2018 14:26
by nguyenoanh
Bạn mở file vhost của doman /etc/nginx/conf.d/domain.com.conf nhé.
Trong đó có hướng dẫn đủ để bạn tự edit được. :)

Về Ubuntu hay centos thì như nhau thôi. Quan trọng là bạn chọn giữa Apache và Nginx

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:23 Nov 2018 09:44
by olalavui
Centos thì có giải pháp Centoswebpanel cũng ổn mà ...

Tại mỗi tội nó cũng ngốn ram (hơi hơi) nên mình k xài nữa - dù nâng cả lên pro để xài cũng là support thêm tính năng, còn nếu config ngon chắc phải dịch vụ :D
Tất nhiên nó k ngốn như kiểu a cpanel / DA default :v

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:25 Nov 2018 22:02
by dungle79
nguyenoanh wrote:
22 Nov 2018 14:26
Bạn mở file vhost của doman /etc/nginx/conf.d/domain.com.conf nhé.
Trong đó có hướng dẫn đủ để bạn tự edit được. :)

Về Ubuntu hay centos thì như nhau thôi. Quan trọng là bạn chọn giữa Apache và Nginx
Admin chỉ giúp , nếu thế thì mình edit cái file đó thêm nội dung gì nữa thì mới bật được mod_rewrite lên ? MÌnh chỉ abc nên cài theo hướng dẫn thôi .

Re: Bật Mod_rewrite trong VPSSIM

PostPosted:26 Nov 2018 23:09
by nguyenoanh
dungle79 wrote:
25 Nov 2018 22:02
nguyenoanh wrote:
22 Nov 2018 14:26
Bạn mở file vhost của doman /etc/nginx/conf.d/domain.com.conf nhé.
Trong đó có hướng dẫn đủ để bạn tự edit được. :)

Về Ubuntu hay centos thì như nhau thôi. Quan trọng là bạn chọn giữa Apache và Nginx
Admin chỉ giúp , nếu thế thì mình edit cái file đó thêm nội dung gì nữa thì mới bật được mod_rewrite lên ? MÌnh chỉ abc nên cài theo hướng dẫn thôi .
Mode bạn cần trên Nginx không có, nó chỉ có trên Apache thôi :(