• amila

    (@flatworld21)


    I installed wordpress and set the like to be “/archives/%post_id%”
    But all the pages can not be accessed.
    I checked .htaccess and found no problem

    my phpinfo
    http://flatvpn.com/phpinfo.php

    RewriteEngine On
    
    RewriteBase /
    
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    
    RewriteCond %{REQUEST_FILENAME} -d
    
    RewriteRule ^ - [L]
    
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    
    RewriteRule . index.php [L]
    
    # 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
    
    # Wordfence WAF
    <IfModule mod_php5.c>
    	php_value auto_prepend_file '/var/www/html/wordfence-waf.php'
    </IfModule>
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    
    # END Wordfence WAF
Viewing 7 replies - 1 through 7 (of 7 total)
  • If I read correctly this is the answer you may be looking for.

    “Archive pages, whether post type archive pages, category archives, date archives etc, search pages, single pages and the homepage are pseudo pages, in other words, fake pages. They don’t have ID’s as they do not exist because they are not created pages which is saved in the db

    These pages “inherits” the ID of the specific post or archive they display, although they still don’t have an ID themselves, accept the homepage, date archives, search pages and post type archive pages

    So, in short, your custom post archive page will not have an ID.”

    Credit

    Thread Starter amila

    (@flatworld21)

    Thanks!
    I changed link to the following type:
    http://flatvpn.com/2016/07/sample-post/

    But still can not open all the pages.

    When you go to that specific post is that the url it is showing?

    And are you changing each individual link to that new structure or changing the structure under your permalink settings? They should all change automatically when you change your permalinks, but I would double check to make sure that they did.

    Thread Starter amila

    (@flatworld21)

    I checked every
    Maybe rewrite is not working

    I can only open pages by this kind of permalink
    http://flatvpn.com/?p=123

    Thread Starter amila

    (@flatworld21)

    Ok I solved by

    follow (AllowOverride none)

    and change to

    (AllowOverride All)

    in

    /etc/httpd/conf/httpd.conf

    Ok great, glad we got it fixed.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘rewrite can not work’ is closed to new replies.