D
D
Denis Artamonov2015-06-16 13:09:42
Apache HTTP Server
Denis Artamonov, 2015-06-16 13:09:42

Setting an alias via htaccess?

There is an address:
site.ru/test/stores/forum
, an alias is registered for it:
forum.site.ru
, the following rules are used:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.site.ru [NC]
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.forum.site.ru [NC]
RewriteRule ^(.*)$ http://forum.site.ru/$1 [R=301,L]

RewriteCond %{REQUEST_URI} !^/test/stores/forum
RewriteCond %{HTTP_HOST} ^forum.site.ru$ [NC]
RewriteRule ^index\.php(.*)$ /test/stores/forum/$1 [L,QSA]

everything works fine, when requesting forum.site.ru, it sends us to the site.ru/test/stores/forum/ folder and at the same time the address changes to forum.site.ru
, but if we go further (added to the /test1/ address) :
site.ru/test/stores/forum/test1
then stops processing the address of the form:
forum.site.ru/test1
-----
tell me what needs to be added so that when the alias is substituted, the rest of the address works fine?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
ShamblerR, 2015-06-16
@ArtamonovDenis

And this is because the mat part of my friend you don’t know well
1 option RewriteBase / is in your hands
Option 2
Option 3
change to
RewriteCond %{REQUEST_URI} !^/test/stores/forum.*

O
ost007, 2020-01-29
@ost007

Good afternoon!
I have a similar situation. What is being said here, does it download the “.htaccess” file, which is located in the “site.ru” site folder?
And what should be written then in “.htaccess” inside the site folder “forum.site.ru”?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question