Title: Solution: HTTPS SSL certificate causing 404 error with custom permalinks
Last modified: August 21, 2016

---

# Solution: HTTPS SSL certificate causing 404 error with custom permalinks

 *  Resolved [suprimax](https://wordpress.org/support/users/suprimax/)
 * (@suprimax)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/)
 * Hi,
 * since I struggled with this issue for a while, I think it would be helpful to
   share the solution with the community.
 * What I have:
    Wordpress on Apache with WooCommerce running on Ubuntu (hosted 
   by Linode). I bought PayPal Pro plugin to accept payments on my website. Bought
   SSL certificate from Comodo and activated it (let me know if you need the steps,
   but it involves running openssl command and copying bunch of certificates) to
   files. At the end I had default-ssl file in available-sites directory that pointed
   to my private key, public certificate from SSL company and some intermediate 
   file. To enable the SSL I had to run “sudo a2ensite default-ssl” and confirmed
   that SSL was working by going to [https://<my](https://<my) websites> that prompts
   a message “It works!”.
 * When I forced SSL on checkout pages through WooCommerce configuration – I start
   receiving error 404 (page not found) on these pages.
 * After quick research I found that there are many posts that indicate “pretty”
   links are not supported through SSL and the only way to make them work is to 
   change permalinks to default and get this ugly ?page_id link.
    This solution 
   was not acceptable for us as all product pages are already hard linked by 3-rd
   party websites and loosing all these goodies just for the sake of ssl did not
   make sense. So, I made executive decision to keep custom permalinks. Finally 
   came across article that suggested to modify default-ssl file and add the same
   directives that make permalink work in htaccess file.
 * Here is content of my default-ssl file. Please substitute ip address and directory
   with values applicable to your environment.
    <VirtualHost _default_:443> ServerName
   <ipaddress>:443 ServerAdmin webmaster@localhost
 *  DocumentRoot /home/webadmin/public/<website>/public/
    <Directory /home/webadmin/
   public/<website>/public/ > AllowOverride All <IfModule mod_rewrite.c> RewriteEngine
   On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME}!-
   f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule
   > </Directory>
 * …. other SSL stuff ….
 * Lat command:
    /etc/init.d/apache2 reload
 * and I got my https properly showing the webpages with https and custom permalinks.
 * Hope this helps!
 * Max

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

 *  [johnpindy](https://wordpress.org/support/users/johnpindy/)
 * (@johnpindy)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384162)
 * Max, you just saved me untold hours of pain and suffering. Thanks for posting
   this, just what I needed,
 *  [buddhaflow](https://wordpress.org/support/users/buddhaflow/)
 * (@buddhaflow)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384193)
 * Star! You’re amazing! I NEVER would have figured this out on my own, and figuring
   the frequency of mod_rewrite with WordPress and SSL, I’m surprised nobody else
   had.
 * Max, thank you!
 *  [atomicreach](https://wordpress.org/support/users/atomicreach/)
 * (@atomicreach)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384202)
 * Thank you so much 🙂
 *  [johnnyBash](https://wordpress.org/support/users/johnnybash/)
 * (@johnnybash)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384220)
 * Which part is .htaccess and which part goes in default-ssl?
    Is it possible to
   access this stuff on a shared hosting server, just through cPanel or FTP? Or 
   do you need to do all that ugly SSH stuff?
 *  Thread Starter [suprimax](https://wordpress.org/support/users/suprimax/)
 * (@suprimax)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384221)
 * Everything goes to default-ssl.
 * The .htaccess contains regular wordpress stuff:
    <IfModule mod_rewrite.c> RewriteEngine
   On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME}!-
   f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule
   >
 * I am not sure about shared environment – I use the virtual private server where
   I have full access to all files.

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

The topic ‘Solution: HTTPS SSL certificate causing 404 error with custom permalinks’
is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 5 participants
 * Last reply from: [suprimax](https://wordpress.org/support/users/suprimax/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/solution-https-ssl-certificate-causing-404-error-with-custom-permalinks/#post-4384221)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
