• I moved my site from Bluehost, where post-name symlinks worked. I moved to the above. rewrite is enabled.

    I exported the database, zipped and Dled the wp folder.
    I changed the relevant lines in config.php. I changed the site URL in options in the database. I did a search and replace to change to the correct site URL.

    Post name URLS did not work. I changed to plain, they did work. I changed back to post name, they don’t work. I changed back to plain and then deleted the .htaccess file, and changed back to post name.

    Wordpress generated this .htacess:

    # 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.
    
    # BEGIN Math Captcha
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post.php*
    RewriteCond %{HTTP_REFERER} !.*www.meuslocus.net.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) ^https://%{REMOTE_ADDR}/$ [R=301,L]
    </IfModule>
    # END Math Captcha
    
    RewriteCond %{REQUEST_FILENAME} -s
    RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
    RewriteCond %{HTTP_USER_AGENT} !Twitterbot/[0-9]
    RewriteCond %{HTTP_USER_AGENT} !Googlebot/[0-9]
    RewriteRule wp-content/uploads/wp-import-export-lite(\/[A-Za-z0-9_@.\/&+-]+)+\.([A-Za-z0-9_@.\/&+-]+)$ [L]
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /ml/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /ml/index.php [L]
    </IfModule>
    
    # END WordPress

    The links don’t work.
    I turned off all plugins, switched to plain, deleted the .htaccess and changed back to postname.Wordpress generated this .htaccess:

    # 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 /ml/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /ml/index.php [L]
    </IfModule>
    
    # END WordPress

    Links don’t work.

    Anyone have any idea on what to do?

    • This topic was modified 1 year, 10 months ago by Rick.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • If this is your own VPS (or dedicated box), check Apahe’s mod_rewrite module is installed and enabled. Without this, the rewrite rules have no effect.

    Then check your Apache vhost’s conf to be sure you’re allowing overrides. Without this, the stuff in the .htaccess file is ignored completely.

    If you’re using Ubuntu (or Debian), see: https://bobcares.com/blog/how-to-enable-mod_rewrite-in-apache-ubuntu/

    Good luck!

    Thread Starter Rick

    (@rick71)

    TOWER:~ # a2enmod mod_rewrite
    "mod_rewrite" already present

    I only had templates in /etc/apache2/vhosts.d. I put httpd-vhosts.conf in that directory and put his into it”

    <VirtualHost *:80>
      ServerName localhost
      ServerAlias localhost
      DocumentRoot "${INSTALL_DIR}/www"
      <Directory "${INSTALL_DIR}/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
      </Directory>
    </VirtualHost>

    I restarted apache2 and was not able to log in. I renamed the file to httpd-vhosts.conf.new and restarted apache2 and could again log in.

    In case it isn’t obvious, I have no knowledge of vhosts or vhost files.

    Thread Starter Rick

    (@rick71)

    In case it is necessary, I am using open Suse 15.3 (I’ll be moving to 15.4 soon)

    I have 2 wordpress sites in htdocs accessed by the same domain name but different install directories.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘404 with pos-name links after migration’ is closed to new replies.