P
P
Prolex2016-01-19 16:11:52
htaccess
Prolex, 2016-01-19 16:11:52

Where can I find the .htaccess reference?

Hello connoisseurs and experts. The question is simple - where can I find all the functions of .htaccess? I'm new to this, so any hint would be welcome. There is .htaccess on the hosting, I made it myself. It seems that PS also bring visitors to the site and everything works, but I would like not only to make sure that it is correct, but also to learn how to understand at least the basic parameters.
Thanks in advance for your help...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2016-01-19
@IceJOKER

first of the site, and then
https://beget.ru/articles/htaccess
htaccess.net.ru

P
Prolex, 2016-01-20
@Prolex

Thanks for the answer. I apologize with pneumonia, I suffer, my head does not understand at all. The problem is the following. There are two versions of the site - main and mobile on a subdomain. The main PS is indexed without errors, I just added a mobile one the other day. Checking .htaccess by online services shows that half of the conditions are not met, so what's the point then. And in general, "I am tormented by vague doubts" about the correctness of the compilation, I am a teapot in this matter. Do not refuse help, tell me what and where is wrong. I'll try to upload both files. Thank you in advance for your help.
Main site file

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www.remdomteh.com.ua$ [NC] 
RewriteRule ^(.*)$ http://remdomteh.com.ua/$1 [R=301,L]
Options +FollowSymLinks

RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.html($|\ |\?)

RewriteRule ^ /%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]

RewriteCond %{HTTP_USER_AGENT} ((.*iPhone.*)|(.*iPod.*)|(.*BlackBerry.*)|(.*Android.*Mobile.*)|(.*Windows\ CE.*)|(.*IEMobile.*)|(.*Opera\ Mini.*)|(.*Opera\ Mobi.*))
RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|png|css|js|txt|ico|pdf|bmp|tif|mp3|wav|wma|asf|mp4|flv|mpg|avi|csv|doc|docx|xls|xlsx|ppt|pptx|zip|rar|tar|gz|dmg|iso)$ [NC]
RewriteCond %{HTTP_REFERER} !^[url]http://remdomteh.com.ua(/)?[/url]
RewriteRule ^(.*)$ http://m.remdomteh.com.ua/$1 [L,R=302]
</IfModule>

ErrorDocument 404 /404.html

And this is for the mobile version, on a subdomain.
<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

</IfModule>

ErrorDocument 404 /404.html

What you need is just to remove the display from www in the address, at the end of index.html and php, enable redirection to the mobile version from the main site. Compression can be added, otherwise PageSpeed ​​mentions it all the time. Apache server and gzip included.
Thank you for your understanding and help)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question