Redirecting Sakura Server Initial Domain

Asked 2 months ago, Updated 2 months ago, 1 views

Sakura Server Initial Domain
https://○○○.sakura.ne.jp/●●● (designated folder that cannot be changed)
using the URL (already SSLized) in
I'd like to create a site
I would like to redirect the URL to https://○○○.sakura.ne.jp.
.htaccess directly below the specified folder

RewriteEngine on
RewriteCon%{HTTP_HOST}^abcd\.sakura\.ne\.jp(:80)?$
RewriteRule^(.*)$http://○○○.sakura.ne.jp/$1 [R=301,L]

Should I write that?I tried, but it didn't work.

It would be very helpful if someone could tell me.

php

2022-09-30 11:19

1 Answers

Sakura Internet access control with .htaccess: If encryption (SSL) is enabled, from I want to direct you to the encrypted page

RewriteEngine On
RewriteCond%{HTTPS} off
RewriteRule^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[R=301,L]

can be redirected in the .

adding
The usual setting for Sakura's shared rental server is when the domain is "sakura.ne.jp", and the web publish directory (document root) is set to "/home/account name/www/", so I don't think there are any public folders that cannot be changed (I'm sorry if I made a mistake).
For your information,
To redirect "/home/account name/www/abc/" as the document root,
I think I can write the domain sorting description as below.(like shared servers at the end of the 20th century)

RewriteCond%{HTTP_HOST}^(account name.sakura.ne.jp)
RewriteCond%{REQUEST_URI}!^/abc/
RewriteRule^(.*)$/%{HTTP_HOST}/abc/$1/[L]

Caution! Please be careful not to let infinite LOOP


2022-09-30 11:19

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.