Redirecte ett subdomene til ett tilleggsdomene.

14 posts in this topic

Verdens enkleste ting er plutselig ikke mulig lenger...

Share this post


Link to post
Share on other sites

Hei,

 

Det bør være mulig, men avhengig av behovet så kan det hende du må benytte .htaccess filen og legge inn regler der. Er det via cPanel du forsøker å legge inn videresendingen?

Share this post


Link to post
Share on other sites

På 26.3.2022 at 22.47, PRO ISP Jon Eivind skrev:

Hei,

 

Det bør være mulig, men avhengig av behovet så kan det hende du må benytte .htaccess filen og legge inn regler der. Er det via cPanel du forsøker å legge inn videresendingen?

Ja, dokumentroten skal være den samme som subdomenet om jeg har skjønt det rett, så redirecter man til domenet. Enkelt, men kanskje jeg ikke skulle knyttet tillegsdomenet til webhotellet?

Share this post


Link to post
Share on other sites

Hei igjen,

Jo, det skal fungere greit det også. Du må ha noe slikt som dette i .htaccess filen for at det skal fungere:
 

RewriteEngine on

RewriteCond %{HTTP_HOST} ^subdomene.hoveddomene.no
RewriteRule (.*) https://www.tilleggsdomene.no/ [R=permanent,L]

Share this post


Link to post
Share on other sites

# MODX supports Friendly URLs via this .htaccess file. You must serve web
# pages via Apache with mod_rewrite to use this functionality, and you must
# change the file name from ht.access to .htaccess.
#
# Make sure RewriteBase points to the directory where you installed MODX.
# E.g., "/modx" if your installation is in a "modx" subdirectory.
#
# You may choose to make your URLs non-case-sensitive by adding a NC directive
# to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]

RewriteEngine On
RewriteBase /


# Prevent rewrite the .well-known directory used by LetsEncrypt by rules below of this rule
RewriteRule "^\.well-known/" - [L]


# Prevent dot directories (hidden directories like .git) to be exposed to the public
# Except for the .well-known directory used by LetsEncrypt a.o
RewriteRule "/\.|^\.(?!well-known/)" - [F]


# Rewrite www.example.com -> example.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#
# or for the opposite example.com -> www.example.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} !^$
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} (.+)$
#RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] .


# Force rewrite to https for every host
#RewriteCond %{HTTPS} !=on [OR]
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


# Redirect the manager to a specific domain - don't rename the ht.access file
# in the manager folder to use this this rule
#RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
#RewriteCond %{REQUEST_URI} ^/manager [NC]
#RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]


# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


# For servers that support output compression, you should pick up a bit of
# speed by un-commenting the following lines.

#php_flag zlib.output_compression On
#php_value zlib.output_compression_level 5
 

Share this post


Link to post
Share on other sites

Ble svimmel nok bare av å åpne filen.

Hvem, hva, hvor?

Share this post


Link to post
Share on other sites

På 26.3.2022 at 23.01, PRO ISP Jon Eivind skrev:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^subdomene.hoveddomene.no
RewriteRule (.*) https://www.tilleggsdomene.no/ [R=permanent,L]

RewriteEngine on

RewriteCond %{HTTP_HOST} ^bergenshistoriskekirkegaarder.mathiasbeyer.no
RewriteRule (.*) https://www.historiskekirkegaarder-com.mathiasbeyer.no/ [R=permanent,L]

 

Eller .com?

Share this post


Link to post
Share on other sites

Prøv (antar historiskekirkegaarder.com er domenet det skal videreføres til):

RewriteEngine on

RewriteCond %{HTTP_HOST} ^bergenshistoriskekirkegaarder.mathiasbeyer.no
RewriteRule (.*) https://www.historiskekirkegaarder.com [R=permanent,L]

Share this post


Link to post
Share on other sites

På 26.3.2022 at 23.34, PRO ISP Jon Eivind skrev:

RewriteCond %{HTTP_HOST}

Alle sammen?

Share this post


Link to post
Share on other sites

På 27.3.2022 at 0.01, PRO ISP Jon Eivind skrev:

Ja, du må ha alt.

Ok, den redirecter, men dokument rooten må være feil.

Har prøvd det meste, men...

Forbidden
You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Share this post


Link to post
Share on other sites

Hei,

Du må ha .htaccess filen i dokumentroten til tilleggsdomenet/subdomenet. Jeg sjekket for deg og ser at du ikke har lagt filen der.

Share this post


Link to post
Share on other sites

Nei hvordan skulle jeg vite det?

Ihvertfall så virker det fortsatt ikke.

 

Det er vel bare å gi opp hele greien.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now