• Plans & Pricing
  • Log in
  • Get started
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress 
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Get started
  • Sign up
  • Log in
About
  • Plans & Pricing
Products
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress  
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Jetpack App
  • Learn more
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Search
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Forums / 403 Forbidden Errors in WordPress Admin After Switching from HTTP to HTTPS

403 Forbidden Errors in WordPress Admin After Switching from HTTP to HTTPS

  • Unknown's avatar
    jazeemlk · Member · Nov 13, 2024 at 10:19 am
    • Copy link Copy link
    • Add topic to favorites Add topic to favorites

    I recently switched my WordPress site from HTTP to HTTPS. While the front end is functioning correctly, aside from a few minor issues with certain plugins, I am encountering a significant problem in the admin area. Specifically, when attempting to add a new post, I am continually met with a ‘403 Forbidden’ error upon navigating to the new post page.

    what I have done but not success yet :

    1.verified htaccess by debugging

    2.

    function add_cors_header() {
        $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
        $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : null;
    
        if (CORS_DEBUG) {
            error_log('referer: ' . ($referer ?? 'null') . ', origin: ' . ($origin ?? 'null'));
        }
    
        $site_url = substr(site_url(), strpos(site_url(), '//'));
    
        if ($referer !== null && preg_match('#^https?:' . $site_url . '#i', $referer) !== 1) {
            if (CORS_DEBUG) {
                error_log('Test if CORS allowed for: ' . $referer);
            }
            // Additional logic here
        }
    }

    3. file permissions 645 and folder permissions 755

  • Unknown's avatar
    caimin · Staff · Nov 13, 2024 at 11:38 am
    • Copy link Copy link

    Hi, can you let us know which site this relates to? Thanks!

  • Unknown's avatar
    jazeemlk · Member · Nov 13, 2024 at 11:51 am
    • Copy link Copy link

    sorry, its solved.

  • The topic ‘403 Forbidden Errors in WordPress Admin After Switching from HTTP to HTTPS’ is closed to new replies.

Tags

  • account
  • currency
  • design

About this topic

  • In: Support
  • 2 participants
  • 2 replies
  • Last activity 1 year
  • Latest reply from jazeemlk

Couldn't find what you needed?

Contact us

Contact us

Get answers from our AI assistant, with access to 24/7 expert human support on paid plans.

Browse our guides

Browse our guides

Find step-by-step solutions to common questions in our comprehensive guides.

WordPress.com

Products
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Professional Email
  • Website Design Services
  • WordPress Studio
  • Enterprise WordPress
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • WordPress.com Blog
  • Business Name Generator
  • Logo Maker
  • WordPress.com Reader
  • Accessibility
  • Remove Subscriptions
Help
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
  • Developer Resources
Company
  • About
  • Press
  • Terms of Service
  • Privacy Policy
  • Do Not Sell or Share My Personal Information
  • Privacy Notice for California Users
DeutschEspañolFrançaisBahasa IndonesiaItalianoNederlandsPortuguês do BrasilSvenskaTürkçeРусскийالعربيةעִבְרִית日本語한국어简体中文繁體中文English

Mobile Apps

  • Download on the App Store
  • Get it on Google Play

Social Media

  • WordPress.com on Facebook
  • WordPress.com on X (Twitter)
  • WordPress.com on Instagram
  • WordPress.com on YouTube

Automattic

Automattic
Work With Us
    • WordPress.com Forums
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • Manage subscriptions