[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

new to apache....forward all traffic from http to https

hi
i have a rule in place that redirects all traffic from http to https and it kinda works when i hit my site mysite.com/mysite/ it redirects to https://mysite.com/mysite/ but it doesn't display the site but it displays this message "forbidden" " you don't have access to access /mysite/ on this server

this is the rule

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

am i supposed to change any permissions anywhere?

thanks for any help
0
eli2011
Asked:
eli2011
  • 4
  • 2
1 Solution
 
Edwin HofferTechnical ExpertCommented:
Change the above .htaccess code to below one:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L] 

Open in new window


If it's still not working, let me know.

Thanks
Edwin
0
 
eli2011Author Commented:
still get the Forbidden and You don't have permission to access /mysite/ on this server message
0
 
SandyCommented:
is your selinux set to enforcing ?

#sestatus

if yes then

#setenforce 0

and see if this works.

TY/SA
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Edwin HofferTechnical ExpertCommented:
@eli2011

Can you please share your website in PM, so I can check the issue.

Thanks
Edwin
0
 
eli2011Author Commented:
selinux if
0
 
eli2011Author Commented:
selinux is off i mean
0
 
eli2011Author Commented:
not sure what you mean.  post the httpd.conf and ssl.conf files?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now