/    Sign up×
Community /Pin to ProfileBookmark

403 Access is forbidden to the requested page errors on my website

I activate the SSL certificate and enable force redirection via c-panel to https but now my websites didn’t open it says 403 Access is forbidden to the requested page errors on my website.

But when i disable force redirection then it works but only for http not for https. HTTP works but HTTPS not working.

i also check permissions 644 for file and 755 for directories.

and here is the code in my .htaccess file

“`
#Custom default index page
DirectoryIndex index.php
“`

I also add these lines but didn’t work

“`
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} `[R,L]`
“`

when i add these lines in .htaccess file the https urls shows something related to the server/domain hostpapa.
when i click on my website url it redirect me to https urls from http but it shows nothing just 403 forbidden error.
when i stop redirection and remove RewriteEngine On …… code it works fine but its http not secure i want it to be https.
SSL certificate install successfully but https url not working.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ZorgJan 22.2022 — Change ^.*$ to ^(.*)$ and take the ticks off around the [R,L]

Should be
``<i>
</i>RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]<i>
</i>
``
×

Success!

Help @mohsin186 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...