最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Permalinks are not working in Wordpress in digitalocean

programmeradmin0浏览0评论

I deployed My Wordpress Blog in one of my subdomains in Digital Ocean. I am running apache2 as my webserver.

When I am trying to change my permalink settings to settings other than plain(Only plain setting is working), I am getting 404 Page

404 page

Can anyone help to fix this problem?

I tried activating mods)_rewrite module - apache and tried to create new .htaccess file in the wordpress root folder.

.htaccess file related to my WordPress installation:

  # 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 Virtual host file related to Wordpress Site:


<VirtualHost *:80>
    ServerName blog.gopibabu.live
    ServerAlias www.blog.gopibabu.live

    DocumentRoot /var/www/MyBlog

        <Directory /var/www/MyBlog>
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          Require all granted
        </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =blog.gopibabu.live [OR]
    RewriteCond %{SERVER_NAME} =www.blog.gopibabu.live
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

I need my permalinks to work in my WordPress installation !!!

I deployed My Wordpress Blog in one of my subdomains in Digital Ocean. I am running apache2 as my webserver.

When I am trying to change my permalink settings to settings other than plain(Only plain setting is working), I am getting 404 Page

404 page

Can anyone help to fix this problem?

I tried activating mods)_rewrite module - apache and tried to create new .htaccess file in the wordpress root folder.

.htaccess file related to my WordPress installation:

  # 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 Virtual host file related to Wordpress Site:


<VirtualHost *:80>
    ServerName blog.gopibabu.live
    ServerAlias www.blog.gopibabu.live

    DocumentRoot /var/www/MyBlog

        <Directory /var/www/MyBlog>
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          Require all granted
        </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =blog.gopibabu.live [OR]
    RewriteCond %{SERVER_NAME} =www.blog.gopibabu.live
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

I need my permalinks to work in my WordPress installation !!!

Share Improve this question asked Aug 27, 2019 at 19:24 GopibabuGopibabu 114 bronze badges 2
  • I would start by asking if you are using wordpress default twenty* themes? or a custom theme? Sometimes custom themes have CPT or related slug changes that cause issue. if you are using custom theme, please switch to the base theme and see if that works? – Wali Hassan Commented Aug 27, 2019 at 19:59
  • Switching to Default Theme didn't fix the issue with permalinks!! – Gopibabu Commented Aug 28, 2019 at 22:50
Add a comment  | 

1 Answer 1

Reset to default 1

This fixed my issue with permalinks :

https://www.youtube/watch?v=YaL72Ho_Fr8

NOTE: In my case, I edited the virtual hosts files for both HTTP and HTTPS

发布评论

评论列表(0)

  1. 暂无评论