Blogs – Hùng Bun – Phạm Việt Hùng

Fixed: Laravel PHP artisan migrate Error

Has alert error: ” Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: a lter table `users` add unique `users_email_unique`(`email`))” Edit your AppServiceProvider.php file and inside the boot…

Xem chi tiết

Redirect http to https and www to non-www

I’m currently using functions.php to redirect http urls to https for a site which currently has no SSL certificate: Using file config.php define('WP_HOME','https://'.$_SERVER['HTTP_HOST'].'/'); define('WP_SITEURL','https://'.$_SERVER['HTTP_HOST'].'/'); Redirect non-www to www in .htaccess Using file .htaccess Change your configuration to this (add a…

Xem chi tiết

Using custom/dynamic “slug” for a page

Create a Page Template Add a new page and give it the slug stores Add A Public Query Variable add_filter('query_vars', 'add_state_var', 0, 1); function add_state_var($vars){ $vars[] = 'state'; return $vars; } Add a rewrite rule This will direct your request…

Xem chi tiết