FAQ   •  Поиск
Вход  •  Регистрация
 
20+ ?????? .htaccess

 
Начать новую тему   Ответить на тему    Список форумов newssoft.ru -> HTML5 ? CSS3
Предыдущая тема :: Следующая тема  
Автор Сообщение
admin
Site Admin


Зарегистрирован: 11.09.2008
Сообщения: 505

СообщениеДобавлено: Вт Окт 02, 2018 7:41 pm    Заголовок сообщения: 20+ ?????? .htaccess Ответить с цитатой

20+ ?????? .htaccess, ??????? ?????? ????? ?????? ???????????
???????????? 25/01/2010 ??????? Yaroslav.CH
20 ?????? .htaccess ??????? ?????? ????? ?????? ???????????
??????????? ?????? ???????? — ???????? ?????? ??? .htaccess, ????????? ??????? JP ? ????? DevMoose — ? ????? ????????????? ? ????????????.

?????????? — ??????????????!

??? ?????????? ?????????????, ???????????????? ???? web-??????? Apache — .htaccess (hypertext access) ???????????? ????? ????? ?????? ???????? ? ?????????????? ????????????. ??-???????????, ???????? ???? ????????????? ? ???????? ?????????? ?????? web-??????? (????? ????? ?????????????? ????????? ????? ? ?????? ????? — ??? ?????????? ????????) ? ????? ???? ??????????????? ? ??????? ?????? ?????????? ?????????. ? ???? ?????? ? ?????? ??? 20 ?????? ??? .htaccess ? ?????? ??? ???? ?? ????????????.

?????? ??? ?? ??????, ??????? ???? ???????? ?? ??? ????, ??? ??????????????? ?????????????? .htaccess ????? ???????? ? ???????? ?????????????????? ?????? ?????. ???????????? .htaccess ??? ?????????? ??? ??? ???? ?????? ????? ?????? ? ??? ??????, ???? ??? ?????? ?????????.

????????? ? ???, ??? ?? ??????? ????????? ????? ????????????? ????? .htaccess ??? ?????? ?????, ?????? ??? ??????? ?????-???? ?????????.
????? ????, ??????? — ????????????????? ????????? ???? ?????? ??????? ?? ???????? ?????? web-???????, ???????? ????????. ????????? ????????? ????? ???? ????????? ? ?? ????????.


.htaccess (??. ????. hypertext access) — ???? ?????????????? ???????????? ???-??????? Apache, ? ????? ???????? ??? ????????. ????????? ???????? ??????? ?????????? ?????????????? ?????????? ? ?????????? ??? ?????? ???-??????? ? ????????? ????????? (??????), ????? ??? ??????????? ?????? ? ?????????, ?????????????? ????? ?????? ? ?.?., ??? ????????? ???????? ????????????????? ?????.
???? .htaccess ????? ???? ???????? ? ????? ????????. ????????? ????? ????? ????????? ?? ??? ????? ? ??????? ???????? ? ?? ???? ??? ???????????? (???? ??? ????????? ?? ?????????????? ??????????? ??????????? ?????? .htaccess).

??? ???? ????? ??? ????? .htaccess ????? ???? ????????????, ?????????? ??????????????? ????????? ???????? ????????????????? ????? (???????? ????????? AllowOverride ?????? ???? ??????????? All). ??? ???????, ??????????? ??????????? ???????? ????????? ???????????? ???? ????? .htaccess.
1. ????????? ???????? ?????? ? ??????? ??????
??? ??????? ????, ??????? ????????? ????????, ?????????????? ?? ????? ????? — ?? ????? ????????, ??? ????? ???????? ??? ??????? ? ???????? ???????? ???????? ?? ??? ???????? ?????? ???, ??????????? ? ????? ?????? ????? .htaccess, ???????? ????????????? ???????? ????? ??????????? — ?????????? ???????.

Код:
Options +FollowSymlinks
#????????? ???????? ?????? ? ??????? ??????
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domainname.com/ [nc]
RewriteRule .*.(gif|jpg|png)$ http://domainname.com/img/stop_stealing_bandwidth.gif[nc]

?? ???????? ???????? domainname.com ?? ???? ???????? ??? ? ??????? ??????????? stop_stealing_bandwidth.gif, ??????? ????? ???????? ?????? ??????????? ????????.
2. ????????? ??? ??????? ?? ????????????? User Agents
??? ??????? ????????? ????????????? ????????????? User Agent, ??????? ????? ???? ???????????? ???????? ??? ?????? ??????????? ?????? ????????? ?????????.

Код:
#????????? ?????? ????? ? ???????
SetEnvIfNoCase user-Agent ^FrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Java.* [NC,OR]
SetEnvIfNoCase user-Agent ^Microsoft.URL [NC,OR]
SetEnvIfNoCase user-Agent ^MSFrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Offline.Explorer [NC,OR]
SetEnvIfNoCase user-Agent ^[Ww]eb[Bb]andit [NC,OR]
SetEnvIfNoCase user-Agent ^Zeus [NC]
<limit get="" post="" head="">
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</limit>

?????? User Agent ?????????, ??????? ? ?????? ????????? ?????, ???-?????????, ?????????? ???????, ????-????? ? ?????? ????? ????? ????? ?? ????? List of User-Agents.
3. ????????? ?????? ??? ????, ????? ????????? IP-???????
???? ?? ?????-???? ???????, ?? ?????? ????????? ???? ??? ????????? ?????? ????????? IP-??????? ?????? ? ?????? ????? — ???????? ???? ??? ? ??? .htaccess-????:

Код:
#????????? ?????? ??? ????, ????? ????????? IP-???????
ErrorDocument 403 http://www.domainname.com
Order deny,allow
Deny from all
Allow from 124.34.48.165
Allow from 102.54.68.123

?? ???????? ???????? domainname.com ?? ???? ???????? ???.
4. ??????????? SEO-Friendly 301 Redirect
???? ?? ????????? ???????? ??? ??? ?????? ?????????????? ???????????? ?? ???????????? ???????? (????????), ??? ??????? ?? ??????? ????????? ?????, ??????????? ???? ???:

Код:
#??????????? SEO-Friendly 301 Redirect
Redirect 301 /d/file.html http://www.domainname.com/r/file.html

?? ???????? ???????? domainname.com ?? ???? ???????? ???, ? /d/file.html ? /r/file.html ?? ??????????????? ?????????? ? ????????.
5. ??????? ??????????? ???????? ??????
??? ?????? ??????????? ??? ??????? ??????? ??? ??????? — ? ??????? ?????????? ????, ?? ????? ?????? ??????? ???? ???????? ? ?????????? ???????????? ?????? ??:

Код:
ErrorDocument 401 /error/401.php
ErrorDocument 403 /error/403.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/500.php

?? ???????? ??????? ? ???????? ?????????? ?????? ??????? ????? error ? ?????????? ? ??? ??????????????? ?????.
6. ??????? ?????? ?????? IP ???????
?????? ?? ????-???????????? ??? ????????????? ????????????? ?????? ???????????? ??? IP ? ??????? ?????????? ????, ???????????? ? .htaccess-????.

Код:
#??????? ?????? ?????? IP ???????
allow from all
deny from 145.186.14.122
deny from 124.15.

?????? IP ?????? ????????????? ????? ??? ? ????? Apache ??? ? ??????? ???????? ??????????. ??? WordPress, IP ?????? ????????????? ????? ??????? ? ???????????????? ??????.
7. ????????????? e-mail ????? ??-????????? ??? ?????????????? ???????
??????????? ?????? ???, ??? ????, ????? ?????????? e-mail ????? ??-????????? ??? ?????????????? ???????.

Код:
#????????????? e-mail ????? ??-????????? ??? ?????????????? ???????
ServerSignature EMail
SetEnv SERVER_ADMIN default@domain.com

?? ???????? ???????? default@domain.com — ????? e-mail ???????.
8. ???????? ???????????? ????
????????????? ??? ????????? ??? ????????? ?????? ? ?????? ????? — ??? ??????? ????? ?????????? ?????? 403. ??? ??????? ? ?????? ?????? ? ?????? ????? htaccess, ??????? ??????? ???????????? ?????.

Код:
#???????? .htaccess ????
<files .htaccess>
order allow,deny
deny from all
</files>

9. ??????? ???????? ? ??????? mod_deflate
? ???????? ???????????? ?????????? ?????? ? ??????? Gzip, ?? ?????? ???????????? mod_deflate (???????????????? ???????? ???????). ?????????? ????????? ??? ? ?????? ?????? ????? .htaccess (????? ?? ?????? ???????? .jpg|.gif|.png|.tiff|.ico):

Код:
#??????? ???????? ? ??????? mod_deflate
<ifmodule mod_deflate.c="">
<filesmatch .(js|css)$="">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>

10. ????????? ???? ????? ? ?????????
?????? ??? ????????? ???????? ????? ????? ? ?????????:

Код:
#????????? ???? ????? ? ?????????
<filesmatch .(ico|pdf|flv|jpg|jpeg|png|gif|swf)$="">
Header set Expires "Wed, 21 May 2010 20:00:00 GMT"
</filesmatch>

11. ????????????? ???????? ??-?????????
?????? ????????? ??-????????? ???????? index.html, ?????? ? ??????? ????? ???? ?? ?????? ????????? ??-????????? ????? ?????? ????????.

Код:
#????????????? ?????????????? ???????? ??-?????????
DirectoryIndex about.html

12. ???????? ??????? ????? ? ?????
?? ?????? ???????? ???????? ?????? ??? ??????? ? ????? ????? ??? ???? ?? ????? ???????, ????????? ???? ???:

Код:
#?????? ??????? ?????
<files secure.php="">
AuthType Basic
AuthName "Prompt"
AuthUserFile /pub/home/.htpasswd
Require valid-user
</files>
#?????? ??????? ?????
resides
AuthType basic
AuthName "This directory is protected"
AuthUserFile /pub/home/.htpasswd
AuthGroupFile /dev/null
Require valid-user

??? ????, ????? ???????????? ?????? ? ????? ?? ??????, ?????????? ??????? ???? .htpasswd ? ?????? ? ???? ???? ?????-?????? ? ??????? user:password.
?????? ? ???? ?????? ?????? ????? ???????? ? ???????? ????, ??? ?? ??????? ?????? ? ????? ?????? ????????????. ??????? ??????????? ?????? ???????????. ??? ????? ?????????????? ????????? ????????? ??????? ? ????? .htpasswd. ????????, ??? ?????.

? ????? ??????? ???? ? ???????? ??????? ????? ? ???????? ?????????? ????? ? ?????????? .htpasswd. ?????????? ??????????? ?? ????? ??????? ? ???? ???? ????? ???????????? — Apache, ?? ??????? ??????? ? ?????, ??????? ? ??????? ? ????? ?????? ???????????? — ? ??? ????? ? ????, ??????? ???? ?????????? ???? ?????Confused?????.

13. ?????????????? ?? ??????? ?????? — ?? ?????
????????? .htaccess, ?? ?????? ????????? ??????????????? ?? ??????? ????????? ????? ?? ?????, ??????? ????????? ???:

Код:
#?????????????? ?? ??????? ?????? - ?? ?????
RewriteEngine On
RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=301,L]

??????????????? ???????????? ? ??? ??????, ???? ?? ?????????? ???? ???????????? ???? ?? ????? ???????? ???. ? ???? ?????? ????? ????????????, ??????? ??????? ? ???????? ?????? http://www.olddomainname.com — ????? ????????????? ?? http://www.domainname.com
14. ????????? ???????????
????????????? ????? ??????? ?? ???????? ?????? ????????? ???????? ?????? ?????. ??? ????????????? ??? ????? ??????? ???????? ????? — ??? ??? ??????????? ?? ???? ??????????, ????? ???????? ??????? 304 ??? ??? ?????????, ??????? ?? ???????????. ????? ???????, ??? ????????? ???????? ???????? ??????? ?????????? ?? ????? ?????? ????????? ???????????, ??????? ??? CSS, ? ??????? ?? ?????, ??????? ??? ???????? ? ??? ????. ?? ?????? ???????? ???? ????? ????, ????? ??????????????? ??? ???????? ? ????? (year), ??????? (month) ???, ???????? — ???????? (seconds). ? ??????? ?????? 1 ???.

Код:
#????????? ???????????
FileETag MTime Size
<ifmodule mod_expires.c>
<filesmatch ".(jpg|gif|png|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</ifmodule>

15. ??????? ?????????? ????? ????? ????????? Gzip
??? ????????????? Gzip, ?????? ????? ??????? ????? ????? ????????? ?? ????????????, ????? ???? ??? ???? ????? ????????? ???????.

Код:
#??????? ?????????? ????? ????? ????????? Gzip
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

???????? ????????, ??? ????????? ?????????? ???????? ? ??????? ???????? ?? ????????? ???????.
16. ??????? «category» ?? URL
??? ????????? ?????? http://yourdomain.com/category/blue ?? http://yourdomain.com/blue, ?????? ???????? ????????? ??? ? ????? ?????? .htaccess ?????.

Код:
#??????? category ?? URL
RewriteRule ^category/(.+)$ http://www.yourdomain.com/$1 [R=301,L]

?? ???????? ???????? http://www.yourdomain.com ?? ???? ???????? ???.
17. ????????? ???????? ??????????? ?????
??? ????, ????? ?????????? ?????? ? ???????????, ??????? ????? ????????? ????????????? ?????????? ? ??? ??????????? ???????????? ???????, ???????? ???? ??? ? ???? .htaccess

Код:
#????????? ???????? ??????????? ?????
Options All -Indexes

Update: Jack.Sun ????????? ?????????????? ???????, ??????? ????? ?? ????????? — ?????????? ? ?????? ????? ???? index.html. ?? ???? ???????, ??? ???? ????? ????? ???????? ?????? ? ??? ??????, ???? ?? ?? ???????? ???????? ??-????????? (??. ??????? #11). ? ???? ??????, ?????????? ????????? ????? ? ??? ????? ??????, ??????? ???? ?????? ???? ? ???????? ???????? ??-?????????.

18. ?????????????? RSS-????? WordPress ?? FeedBurner
???? ??? ????????? ????????????? RSS-????? WordPress ?? ?????? Google Feedburner.

Код:
#?????????????? RSS-????? WordPress ?? FeedBurner
<ifmodule mod_rewrite.c="">
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^rss.xml$ http://feeds.feedburner.com/yourfeed [R=302,NC,L]
</ifmodule>

?????????? ?????????? ???????????????? ????? ?????? ????? ? ??????? Feedburner. ????? ?? ???????? ???????? yourfeed ?? ??? ????? ????? ??? ? Feedburner.
19. ????????? ??????????? ?? ????????????? ??? Referrer
???? ????? ????-???? ?????????? ???????? ? ????? wp-comments-post.php, ?? ?????? ?? ???????? ??????? ?????? ?????. ??????????? ???? ??? ????????? ????????????? ???????????, ???????????? ??????????????, ??????? ?????? «?? ????????», ???????? ?????????????? ??? ?????????, ??????? ??????? ?? ???????? ?????? ????? ? ?????-???? ?????? ??????? (????????, ??????????? ?????? Google).

Код:
#????????? ??????????? ?? ????????????? ??? Referrer
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*yourblog.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

?? ???????? ???????? yourblog.com ?? ???????? ??? ?????? ?????.
20. ??????? ?????????? ????? ?? URL
?????? ??? ????????? ??????? ?????????? ????? .php (?? ?????? ???????? ??? ?? ????? ??????, ???????? — .html) ?? URL-??????? ???????.

Код:
#??????? ?????????? ????? ?? URL
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]

21. ???????? ????
?????? ??? ????????? ???????? ???? ?? scripts enjection ? ????????????? ??????????? _REQUEST ?/??? GLOBALS

Код:
#???????? ???????????? ???-??????
Options +FollowSymLinks
#????????? url_rewriting
RewriteEngine On
#????????? ??? ??????, ?????????? <script>
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#????????? ??? ???????, ??????? ???????? ???????? ?????????? PHP Globals:
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#????????? ??? ???????, ??????? ???????? ???????? ?????????? _REQUEST:
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
#?????????????? ??? ???????? ?? ???????? ? ??????? 403 - ?????????
RewriteRule ^(.*)$ index.php [F,L]

????????: WPRecipes.

22. ?????????????? ?????????? ? ??????? ????????? RedirectMatch ? ?????????? ?????????
??? ???? ???????? ?????????, ????????????? ? ????????????? ?????? - RedirectMatch. ?????? ?? ????????????: «????????? ????????? ? ???????? ?????????????? ?????? ???????????? ?????????? ????????? (????????? ?? «? ?????????», ? «?? ???? ??????????, ???? ...»). ???????? ??????? — ???????? ?????????? ? ????????????? ????????? ?????? ????????.

?????????:

Код:
RedirectMatch [status] regexp URL

???????? ???????? (??? ???????? ???-???????) ???????????: permanent (301 — ?????????? ????????), temp (302 — ????????? ????????, ????????? ???), seeother (303 — ????? ????, ??? ????? ????????), gone (410 — ?????? ????????).

??????. ?? ?? ??????????????? ?? ??????? ?????? ?? ????? ??? ??????????? RewriteEngine:»

Код:
RedirectMatch 301 ^(.*)$ www.domainname.com/$1

?? ???? ???????, ??? ?? ?????? ???????????? ?? ?????? ???????, ?? ? ?????? ???????:

Код:
RedirectMatch (.*)\.gif$ http://www.myserver.com$1.png
RedirectMatch (.*\.jpg)$ http://www.myanother.com$1

23. ????????????? ???????? ??? URL ? GET ???????????
? ??? ??????, ???? ????? ??????? ???????? ? URL ? ???????????, ????????: «//www.proofsite.com.ua/wp-trackback.php?p=264», ????????? ? ?. 4. «??????????? SEO-Friendly 301 Redirect» ??????????? — ???????? ?? ?????, ????????? GET ???????? ?????? ?????????? ????????????? ???????.

??? ??????????? ??????????????? URL ? GET ????????, ????? ????????? ????????? ????????? (?? ??????? URL: //www.proofsite.com.ua/wp-trackback.php?p=264):

Код:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^p=264$
RewriteRule ^wp-trackback\.php$ //www.proofsite.com.ua/article-2242.html? [L,R=301]

???????? ????????, «?» ? ????? URL ?? ?????? — ? ??????????? ?????????????? ????!

24. ????????? PHP ? .html ??????
??? ???? ?????????, ????????????? Ruliks — ????????? ?????? ????????????? ??-????????? .html ? .htm ?????? ? ??????? ? ?????????????? ?????????, ? ???????? ?? ????????? php-??????????????.

Код:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html .phtml

??????????? ???????? ????????? ????? ????? .htaccess ?? ???????? ????????? ? ????????? ????????????????? ????? ????? — ????? ?????????? ????? ?????.
Вернуться к началу
Посмотреть профиль Отправить личное сообщение Отправить e-mail
admin
Site Admin


Зарегистрирован: 11.09.2008
Сообщения: 505

СообщениеДобавлено: Вс Окт 21, 2018 9:10 pm    Заголовок сообщения: Ответить с цитатой

301 ????????:

??? ????? 301 ????????
301 ???????? (301 Permanent Redirect) — ????? ???????, ? ????? ????????? ??????????????? ? ?????? url-?????? ?? ??????. ????????? ?????? ??????????????? ????? ????????????? ?????????? ???????????? ??? ????????? ??????? ?? ??????? ?????? ???????? ?? ?????. ???? ????? ??????? ????????? ????????? ????????, ??? ???????? ???? ?????????? ?? ?????? ?????, ??????? ?????? url ????? ??????? ??????????. ????? ????, ??? ??????? ??????????????, ????????? ??????? «??????» ?? ? ????? ?????????? ????????????? ?????.

??? ????????????? 301 ????????
?????????? ????????? ???????? ????? ???????????? ???????? ????????? 301 ??????????:

- ????? php ???????
????? ??????? ???????? ??????? ?????? ????? ???????? ??????? ??????. ???? ??? ???? ?????? ?? ?????-?? CMS, ?? ???? ??????????? ????, ??? ? ??? ???? ??????? ????????? ? ????? ?? ???? index. ? ???? ?????? ???????? index.php, ??????? ????????? ? ????? ?????? ?????? ? ?????????:


Код:
 if($_SERVER['REQUEST_URI'] == "/index.php") {
    header("Location: /",TRUE,301);
    exit();
    }


??? ?????? ?????? ????????? ????? url-????? ?????? ??????????????, ? ?????? - ?? ????? url-????? ?????? ??????????? ???????????????.

- ? ???????????????? ?????, ???????? ? .htaccess
? ????? ?????? ???????? ????? ???????? ?? ?????? ??????? ? ?????????????? ??? ????????? ???????. ? ???? ?????? ?? ????????? ? ????????? ????????? ? ????? .htaccess, ? ?????, ? ????? ??????? ? ? ??????? ????? ?????????? ????? ???? ????????????? ?? ??? ???? ?????????.

? ????? ??????? ????? ???????????? 301 ????????
301 ???????? ? www ?? ??? www (????????? ???????? ???????)

????? ???????????????? ??????, ????? ?????????? ????????? ????????, ??? ????? ???? ???????? ?? ?????????? ??????? ????????????. ????????: http://site.com ? http://www.site.com. ??? ????? ?????? ??????????? ???????, ??? ??? ? ??????? ????????? ?????? ????? ?????????? ?????? ????? ???????. ??????? ? ???? .htaccess ????? ??????????? ???????? ????? ??????:

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

??? ??? ????? ???????
Код:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/robots.*
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]


301 ???????? ? ??? www ?? www


Код:
RewriteCond %{HTTP_HOST} ^([^www].*)$
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]


??? ??? ????? ???????

Код:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site\.ru$ [NC]
RewriteCond %{REQUEST_URI} !^/robots.*
RewriteRule ^(.*)$ http://www.site.ru/$1 [R=301,L]

301 ?? ??????? ?????? ???????? ????? ?? ?????

????? ??? ????? ??????? ????????, ?? ?? ??? ????? ????? ???????????? ??????, ????? ????????? ??? ?????? ? ???????? ?? Page Rank ?????? ????????, ????? ????????? ???????? ? ???? ???????? ?? ??????????? ??????????? ?? ?????? ??????. ? ????? ?????? ??? ????? ?????? ?????????????? ?????? ???? ? ????? .htaccess ?????? ????:


Код:
RewriteCond %{REQUEST_URI} ^/test/$
RewriteRule ^.*$ http://site.ru/new-test/? [R=301,L]

??? test ? new-test – ??? ???????? ???????

301 ???????? ?? ???? ??????? ?????? ?????? ?? ??????? ??????? ??????

????? ??? ????? ????????? ?? ????????? ?????? ????? ????? ??? ?? ?????? ??????? ?????????? ????? ? ?????? ??? ????????????, ??? ????? ?????? ??? ??? ?????????????? ??????? ???? ? ????? .htaccess ???? ?????, ? ???????? ????? ???????? ???????????????:


Код:
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ http://site.ru/ [L,R=301]

??? site.ru – ????, ?? ??????? ????? ???? ????????

301 ???????? ? ?????? ???????? ?????? ?????? ?? ????? ?? ????? ???????

Код:
RewriteCond %{REQUEST_URI} (.*)
RewriteRule ^(.*)$ http://site.ru/$1 [L,R=301]

??? site.ru – ????, ?? ??????? ????? ???? ????????

???????? ? http ?? https

???? ?? ???????? ????????? ?? ?????????? ???????? https, ?????????? ????????? ???????? ? ??????? ???? ?????:

Код:
RewriteCond %{HTTPS} =of
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

??? ????? ??????????? ????? ???????

Код:
RewriteCond %{HTTP:X-HTTPS} !1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

???????? ? https ?? http
Код:
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]


???????? ? https ?? http
Код:
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

301 ???????? ?? ??????? ?? ?????? ?? ??? ????? (??? ????? ?????)


Код:
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} ![^\/]$
RewriteRule ^(.*)\/$ /$1 [R=301,L]


??? ??? ????? ???????

Код:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L]


301 ???????? ?? ??????? ??? ????? ?? ???? (??? ????? ?????)


Код:
RewriteCond %{REQUEST_URI} !\?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !\/$
RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]


??? ??? ????? ???????


Код:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]


301 ???????? ?????? ?????? site.ru/index.php (??? GET ??????????) ?? ???????? ??????? site.ru


Код:
RewriteCond %{REQUEST_URI} /index.php
RewriteCond %{QUERY_STRING} ^\z
RewriteRule ^(.*)$ http://site.ru/? [R=301,L]


??? ??? ????? ???????

Код:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.site.ru/ [R=301,L]


301 ???????? ???? ??????? ? index.php ? GET ??????????? ?? ???????? ?????? ? GET ??????????? (???????? ? url index.php)


Код:
RewriteCond %{REQUEST_URI} /index.php
RewriteRule ^(.*)$ http://site.ru/ [R=301,L]


301 ???????? ??? index.php, index.html ??? index.htm (???????? ? Joomla), ???????? ???????


Код:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html|htm)\ HTTP/
RewriteRule ^(.*)index\.(php|html|htm)$ http://site.ru/$1 [R=301,L]


???????? ? ?????????? ???????? ?? ???????


Код:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteRule ^vnutrenyaya-stranica/$ http://www.site.ru/ [R=301,L]


???????? ? ??????? ?? ?????????? ????????


Код:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteRule ^$ http://www.site.ru/vnutrenyaya-stranica/ [R=301,L]


???????? ???? ?????????? ??????? ?? ???????

Код:
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule !(^$|.*\.(css|jpg|gif)) / [R=301,L]


???????? ? ?????? ?? ?? ????? RU


Код:
RewriteCond %{HTTP_HOST} ^xn-...\.xn--p1ai$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.ru/$1 [R=301,L]


301 ???????? ????????


Код:
RewriteRule ^(.*)/old-catalog/(.*)$ $1/new-catalog/$2 [R=301,L]


??? ??????? ???? ????? ???????? ??? ???????? ?????, ?? ?????? ?? ?????????? ???????????? ????????? ? ??????????????. ??????? ??? ? ????????????? ????????? cms-??????.

?????? ????????????: ?? ?????? ????????? ?? ????????? ????? ???????? 302 ??? ?????? 3?? ????????. ??????? ????????????? ?????? ?????????? ? ???? ??????? [R=301,L].

????? cms-??????? ? ???????? ????????? ???? ??????? ??????? ?????

?????? ??????, ????? ?? ??????????? ?? ?????? cms ? ?????? ????? ??????? ???????? ????????? ???????:

???? - site.com/category/kategoriya

????? - site.com/kategoriya

? ????? ?????? ??? ?????????? ???????? ????????? ?????????? ?? ?????? ???????? ? ???????? ??? ??????? ????????? ?????? ? .htaccess:


Код:
RewriteEngine on
RewriteRule ^category/([^/]+)/?$ $1 [L]


??????? ????????, ??? ? ?????? ?????????? ?????? ? ??????? ??????? ??? ??????? ????? ???? ?? ?? ????? ???????????, ??????? ????? ??? ??? ???????? ?????????? ????? .htaccess, ?????????????? ????????????? ??????? ??? ????? ?? ?????? ??????.

???? ??? ??? ??? ???? ?? ???????, ??????? ?????????? ? ??????????????, ??????? ????? ??????????? ?????? ?????? ? ?????? ?????????? ???????????? ???? ????????.
Вернуться к началу
Посмотреть профиль Отправить личное сообщение Отправить e-mail
Показать сообщения:   
Начать новую тему   Ответить на тему    Список форумов newssoft.ru -> HTML5 ? CSS3 Часовой пояс: GMT + 3
Страница 1 из 1

 
Перейти:  
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах


Powered by phpBB © 2001, 2005 phpBB Group
AllSat 22  - photographe de mariage - 2006