M
M
Maxim Lebedev2014-02-28 13:38:24
Domain name market
Maxim Lebedev, 2014-02-28 13:38:24

How to remove subdomain folder from links?

Greetings!
There was a problem with the subdomain links subdomain.site.ru , which is located in the main domain folder on TimeWeb hosting ( /site.ru/public_html/subdomain/*content* ). The incident is that ALL links look like http://subdomain.site.ru/subdomain/*content* , which of course I don't need. And another interesting fact is that this occurs IN ANY CMS .
How to remove the notorious subdomain folder from the address so that links like http://subdomain.site.ru/*content* work?
Below is the content of .htaccess files.
The content of the root .htaccess ( /site.ru/public_html/.htaccess ):

RewriteEngine on
Options -Indexes
RewriteBase /

RewriteCond %{HTTP_HOST} ^subdomain\.site\.ru$
RewriteCond %{REQUEST_URI} !/subdomain/
RewriteRule ^(.*)$ /subdomain/$1 [L]

The contents of the .htaccess subdomain with the LiveStreet engine, for example ( /site.ru/public_html/subdomain/.htaccess ):
AddDefaultCharset UTF-8
Options -Indexes

RewriteEngine On
RewriteBase /subdomain/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !favicon.ico
RewriteRule ^(.*)$ ./index.php

# Deny access
<Files "plugins.dat">
  order allow,deny
  deny from all
</Files>
<Files "plugin.xml">
  order allow,deny
  deny from all
</Files>
<Files ~ "\.tpl$">
    Order allow,deny
    Deny from all
</Files>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniel Newman, 2015-02-18
@danielnewman

Did anything come out? In the same situation.

S
saitbl, 2016-09-08
@saitbl

The same bullshit. I've already read half of Google, nothing worked. Either the solution just doesn't work, or you end up with an endless redirect.
There is a suspicion that such a trouble is only on the timeweb.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question