Mình dùng vps ovh.Mình muốn khi gõ tên miền abc.xyz->nó sẽ chuyển tới
www.abc.xyz
Dưới đây là cách mình đã làm.
Bác nào có kinh nghiệm chỉ mình với làm hoài mấy ngày không được.Dưới đây là những cách mình tìm được trên google.Nếu có cách dễ hơn thì mình xin
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond % !-f
RewriteCond % !-d
RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond % !^www\\. [NC]
RewriteRule ^(.*)$ http :// www.%/$1 [R=301,L]
</IfModule>
# END WordPress
Một số cách đã làm
1.sudo nano /etc/apache2/conf-available/httpd.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
2.sudo gedit /etc/apache2/apache2.conf
=>AllowOverride All
3.Chỉnh table options
siteurl và home=>http:// www .abc.xyz
=>Mỗi khi chỉnh xong đều có reset lại apach2
sudo service apache2 restart;
Đều nhận được thông báo lỗi
Not Found
The requested URL was not found on this server.