V
V
Valeriy Donika2015-02-03 18:11:26
htaccess
Valeriy Donika, 2015-02-03 18:11:26

Redirect subdomain to subfolder how to do it with .htaccess only?

Good afternoon. Googled, I find a lot of topics, but I can’t choose the right one for myself.
http://www.site.ru/another/any path after/
where another is a subfolder, make it look like
another.site.ru using xtaccess.
found this,
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^test.loc
RewriteRule bbc/(.*)$ bbc.test.loc/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^bbs.test.loc$
RewriteCond %{REQUEST_URI} !^/bbs
RewriteRule ^(.*)$ /bbs/$1 [L,QSA]
and fixed names - 404 error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-02-25
@ShamblerR

And so

#RewriteEngine On
 #RewriteCond %{REQUEST_URI} \.(png|jpg|gif|jpeg|ico|bmp|css|ts|js)$
 #RewriteRule (.*) allpn.ru/$1?&%{QUERY_STRING}[R=301,L]

Just written
Apparently this is what you mean?
RewriteCond %{REQUEST_FILENAME} -f

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question