title: How to repair permalinks on wordpress
body: <p>I just relocated my wordpress application, and lost my permalinks.  I did NOT change URLs.  this is just a server-to-server transfer.  I'm hoping someone can see what I have done here, and tell me where I went wrong.</p>
  
  <p>I'm expecting:  <code>https://trekfederation.com/%postname%</code> to work, but it fails.  When I turn off permalinks, Most of my links come back into play.  Woocommerce still is down, but I think that that particular issue is related.  To that end, I'm placing my .htaccess file and my apache2 virtualhost settings to see if someone can help me figure out where I went wrong.</p>
  
  <p>Thanks</p>
  
  <h2>.htaccess file</h2>
  
  <pre><code># Disable ETags
  &lt;IfModule mod_headers.c&gt;
      Header unset ETag
      Header set Connection keep-alive
  &lt;/IfModule&gt;
  FileETag None
  
  &lt;IfModule mod_headers.c&gt;
    &lt;FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$"&gt;
      Header set Access-Control-Allow-Origin "*"
    &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  # BEGIN DEFLATE COMPRESSION
  &lt;IfModule mod_deflate.c&gt;
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
   AddOutputFilterByType DEFLATE application/javascript
   AddOutputFilterByType DEFLATE application/rss+xml
   AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
   AddOutputFilterByType DEFLATE application/x-font
   AddOutputFilterByType DEFLATE application/x-font-opentype
   AddOutputFilterByType DEFLATE application/x-font-otf
   AddOutputFilterByType DEFLATE application/x-font-truetype
   AddOutputFilterByType DEFLATE application/x-font-ttf
   AddOutputFilterByType DEFLATE application/x-javascript
   AddOutputFilterByType DEFLATE application/xhtml+xml
   AddOutputFilterByType DEFLATE application/xml
   AddOutputFilterByType DEFLATE font/opentype
   AddOutputFilterByType DEFLATE font/otf
   AddOutputFilterByType DEFLATE font/ttf
   AddOutputFilterByType DEFLATE image/svg+xml
   AddOutputFilterByType DEFLATE image/x-icon
   AddOutputFilterByType DEFLATE text/css
   AddOutputFilterByType DEFLATE text/html
   AddOutputFilterByType DEFLATE text/javascript
   AddOutputFilterByType DEFLATE text/plain
   AddOutputFilterByType DEFLATE text/xml
  &lt;/IfModule&gt;
  # END DEFLATE COMPRESSION
  # BEGIN Cache-Control Headers
  &lt;ifModule mod_headers.c&gt;
   &lt;filesMatch "\.(ico|jpe?g|png|gif|swf)$"&gt;
   Header set Cache-Control "public"
   &lt;/filesMatch&gt;
   &lt;filesMatch "\.(css)$"&gt;
   Header set Cache-Control "public"
   &lt;/filesMatch&gt;
   &lt;filesMatch "\.(js)$"&gt;
   Header set Cache-Control "private"
   &lt;/filesMatch&gt;
   &lt;filesMatch "\.(x?html?|php)$"&gt;
   Header set Cache-Control "private, must-revalidate"
   &lt;/filesMatch&gt;
  &lt;/ifModule&gt;
  # END Cache-Control Headers
  
  # php -- BEGIN cPanel-generated handler, do not edit
  # NOTE this account's php is controlled via FPM and the vhost, this is a place holder.
  # Do not edit. This next line is to support the cPanel php wrapper (php_cli).
  # AddType application/x-httpd-ea-php70 .php .phtml
  # php -- END cPanel-generated handler, do not edit
  # BEGIN cPanel-generated php ini directives, do not edit
  # Manual editing of this file may result in unexpected behavior.
  # To make changes to this file, use the cPanel MultiPHP INI Editor (Home &gt;&gt; Software &gt;&gt; MultiPHP INI Editor)
  # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
  &lt;IfModule php7_module&gt;
     php_value zlib.output_compression off
  &lt;/IfModule&gt;
  # END cPanel-generated php ini directives, do not edit
  
  ########### REDIRECT TRAFFIC TO HTTPS ############
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  
  ############## CACHING-GZIP ############
  &lt;IfModule mod_expires.c&gt;
  ExpiresActive On
  ExpiresDefault A2592000
  
  &lt;FilesMatch "\.(txt|xml|js)$"&gt;
  ExpiresDefault A2592000
  &lt;/FilesMatch&gt;
  
  &lt;FilesMatch "\.(css)$"&gt;
  ExpiresDefault A2592000
  &lt;/FilesMatch&gt;
  
  &lt;FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$"&gt;
  ExpiresDefault A2592000
  &lt;/FilesMatch&gt;
  
  &lt;FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$"&gt;
  ExpiresDefault A2592000
  &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_headers.c&gt;
    &lt;FilesMatch "\.(txt|xml|js)$"&gt;
     Header set Cache-Control "max-age=2592000"
    &lt;/FilesMatch&gt;
  
    &lt;FilesMatch "\.(css)$"&gt;
     Header set Cache-Control "max-age=2592000"
    &lt;/FilesMatch&gt;
  
    &lt;FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$"&gt;
     Header set Cache-Control "max-age=2592000"
    &lt;/FilesMatch&gt;
  
    &lt;FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$"&gt;
     Header set Cache-Control "max-age=2592000"
    &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  # BEGIN WPSuperCache
  # END WPSuperCache
  
  # BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <h2>Virtual Host settings</h2>
  
  <pre><code>&lt;VirtualHost *:443&gt;
  DocumentRoot "/var/www/vhosts/trekfederation.com"
  ServerName trekfederation.com
  &lt;Directory "/var/www/vhosts/trekfederation.com"&gt;
          Options Indexes FollowSymLinks
          AllowOverride All
          Require all granted
  &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>