talucgiahoang
Forum Replies Created
-
I also got this error. I have built a website on my Raspberry Pi to learn and have fixed many errors for this.
To solve this error:
Step 1: enable rewrite module$ sudo a2enmod rewrite $ systemctl restart apache2
Step 2: modify apache site configuration
$ sudo nano /etc/apache2/sites-available/000-default.conf
add some directives like below:
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com RewriteEngine on RewriteCond %{SERVER_NAME} =example.com [OR] RewriteCond %{SERVER_NAME} =www.example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] <directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </directory> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Restart Apache
$ systemctl restart apache2
I read from this post Removing Index.php From the URL Slug in WordPress
- This reply was modified 3 years, 11 months ago by talucgiahoang.
- This reply was modified 3 years, 11 months ago by talucgiahoang.
- This reply was modified 3 years, 11 months ago by talucgiahoang.
Changing permalink and setting .htaccess doesn’t not work with me. The .htaccess file is overwritten each time changing permalink and presssing Save button.
I can only create and post new page if I add index.php in the link
Example: in Settings > Permalinks > Custom Structure
https://mysite.com/index.php/%postname%/
https://mysite.com/index.php/archives/%post_id%
https://mysite.com/index.php/%year%/%monthnum%/%postname%/