SiamWebCity.com Ѻҧ䫵úǧ
͡ ѧ   
˹á
web

web
Ѻ䫵
web
͹
web
Domain 299.
web
Դ
web
 
Ѻ䫵úǧ ѺѲ;प Ѻ Facebook iPad iPhone Android Ѻͺҧ䫵 䫵 䫵 䫵 : 鹵Դͷ 繼Ѵͷҹ : ҡͧͷ½ԡĵɰԨ
¡
ǡѺ
ͧ͡
ŧҹҹ
ǡ͹
Ѻ䫵
; Facebook iPhone
mlm ٻ
ʵԧ
ԡѧâ
͹䢡Ѻԡ
ҹѺ
Ӷ辺
Դ

պ
͡ҹ  ͡ҹ
VDO ͹ Dreamweaver  VDO ͹ Dreamweaver
Bitcoin Է¹  Bitcoin Է¹
PHP MySQL  VDO  ͧ  PHP MySQL VDO ͧ
PHP MySQL  紤  PHP MySQL 紤
jQuery  jQuery
HTML5  HTML5
ASP net   MS SQL  ASP net MS SQL
facebook app  facebook app
JSP  JSP
Oracle  Oracle
CSS  CSS
Google  Google
iphone ipad iphone itune ios  iphone ipad iphone itune ios
SEO  SEO
SQL Server  SQL Server
AJAX  AJAX
ôѵѵ  ʻԧ  ôѵѵ ʻԧ
   Թ   Թ
JavaScripts  JavaScripts
cloud computing  cloud computing
xhtml  xhtml
Photoshop  Photoshop
RSS Feed  RSS Feed
wordpress  wordpress
Computer  Computer
MLM µç §ҹ  MLM µç §ҹ
NUTT's blog  NUTT's blog
մԨԵ DVB T2  մԨԵ DVB T2
Bootstrap CSS  Bootstrap CSS

Ѻ͹ PHP, MySQL, HTML, CSS, Javascripts, FTP, Dreamweaver,PHPMyAdmin, Appserv, WMSEVER, php-Nuke , Joomla, SMF, Oscommerce, Phpbb, Paypal, Adwords¹ҧ纡ѹ
ԡ͹ й Adwords , PHP, MySQL, HTML, FTP, SMF, PHPMyAdmin, Dreamweaver, Oscommerce, Photoshop, Flash...

test speed
Display Pagerank
ʶԵ䫵

URL RewriteCond



SEO > URL RewriteCond


The RewriteCond directive

The cannonic documentation about the Apache directives can be found here Apache HTTP Server Version 1.3 - Module mod_rewrite - URL Rewriting Engine. Another very useful help is given in the page Apache HTTP Server Version 2.0 - URL Rewriting Guide.

Important: This page is designed to teach you the basics of the RewriteRule directive. Please refer to the cannonic pages to get a full approach.

The RewriteCond directive allow to specify the condition(s) of an URI rewriting.

RewriteCond TestString CondPattern Flag (optionnal)
TestString is the string to be tested. It can be many things, but for a start, we will test Server-Variables. These are variables of the form: 
%{NAME_OF_VARIABLE}
 where NAME_OF_VARIABLE can be a string taken from the following list:

HTTP headers:
HTTP_USER_AGENT (e.g. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0)
HTTP_REFERER (e.g. The location from which the request has been issued.)
HTTP_COOKIE (e.g. a session cookie)
HTTP_FORWARDED
HTTP_HOST (e.g. www.html4.com)
HTTP_PROXY_CONNECTION
HTTP_ACCEPT (e.g. text/xml,application/xml,application/xhtml+xml,text/html;q=
0.9,text/plain;q=0.8,image/png,*/*;q=0.5)
connection & request:
REMOTE_ADDR (e.g. 82.228.162.118)
REMOTE_HOST (e.g. sp137-1-82-228-162-118.fbx.proxad.net)
REMOTE_USER
REMOTE_IDENT
REQUEST_METHOD (e.g. GET)
SCRIPT_FILENAME (e.g. /home/httpd/vhosts/html4.com/httpdocs/test.php)
PATH_INFO
QUERY_STRING (e.g. the parameters following the HTTP_REFERER - and not HTTP_REFERER + any parameters as I wrote here before)
AUTH_TYPE
server internals:
DOCUMENT_ROOT (e.g. /home/httpd/vhosts/html4.com/httpdocs)
SERVER_ADMIN (e.g. webmaster[at]html4.com)
SERVER_NAME (e.g. www.html4.com)
SERVER_ADDR (e.g. 66.98.134.64)
SERVER_PORT (e.g. 80)
SERVER_PROTOCOL (e.g. HTTP/1.1)
SERVER_SOFTWARE (e.g. Apache/2.0.40 (Red Hat Linux))
system stuff:
TIME_YEAR
TIME_MON
TIME_DAY
TIME_HOUR
TIME_MIN
TIME_SEC
TIME_WDAY
TIME
specials:
API_VERSION
THE_REQUEST
REQUEST_URI (e.g. /test.php)
REQUEST_FILENAME
IS_SUBREQ
NOTA : You can match this list against a phpinfo() command if you are running a PHP-written site.

Ive not had to try every variables. Here is the list of variables Ive used so far :

HTTP_USER_AGENT
HTTP_REFERER
HTTP_HOST
REMOTE_ADDR
REMOTE_HOST
SCRIPT_FILENAME
So our RewriteCond directive will be some kind of:

RewriteCond %{HTTP_USER_AGENT} CondPattern Flag (optionnal)
RewriteCond %{HTTP_REFERER} CondPattern Flag (optionnal)
RewriteCond %{REMOTE_ADDR} CondPattern Flag (optionnal)
RewriteCond %{REMOTE_HOST} CondPattern Flag (optionnal)
RewriteCond %{SCRIPT_FILENAME} CondPattern Flag (optionnal)
Now, lets see the CondPattern part of it. Its a bit more complex, for you need to know what a regular expresion is. Well, if you do not, you gonna feel lonely. Read this page first :Using Regular Expressions, by Stephen Ramsay - Electronic Text Center - University of Virginia, and then, come back here. In the forthcoming pages, Ill assume you do know about regular expressions. Your CondPattern can be any regular expression on the considered string.

For instance, to discriminate any user agent containing the string Frontpage:

RewriteCond %{HTTP_USER_AGENT} Frontpage
Flags will allow you to tweak the rewriteCond behaviour. For instance, to discriminate any user agent containing the string Frontpage without case sensibility, just set the [NC] flag (NC for no case):

RewriteCond %{HTTP_USER_AGENT} Frontpage [NC]
A flag is optionnal. Between two adjacent RewriteCond directives is an implicit logical AND. You will need the [OR] flag to set a logical OR. For instance, to discriminate any user agent containing the string Frontpage without case sensibility (NC = no case) AND any referer containing foo:

RewriteCond %{HTTP_USER_AGENT} Frontpage [NC]
RewriteCond %{HTTP_REFERER} foo
For instance, to discriminate any user agent containing the string Frontpage without case sensibility (NC = no case) OR any referer containing foo, add an OR flag separated by a comma:

RewriteCond %{HTTP_USER_AGENT} Frontpage [NC,OR]
RewriteCond %{HTTP_REFERER} foo
For instance, to discriminate any user agent containing the string Frontpage without case sensibility (NC = no case) OR any referer containing foo AND a remote host ending with myprovider:

RewriteCond %{HTTP_USER_AGENT} Frontpage [NC,OR]
RewriteCond %{HTTP_REFERER} foo [OR]
RewriteCond %{REMOTE_HOST} myprovider$
You can specify a non-matching pattern with a ! sign before it. For instance, to discriminate any user agent containing the string Frontpage without case sensibility (NC = no case) OR any referer containing foo AND a remote host NOT ending with myprovider:

RewriteCond %{HTTP_USER_AGENT} Frontpage [NC,OR]
RewriteCond %{HTTP_REFERER} foo [OR]
RewriteCond %{REMOTE_HOST} !myprovider$
And so on


Short URL click! Facebook Share
<< Back : Ҫ 5,260 : 仴ҹ
Ѻ Ѻҧ纺 Ѻ䫴 webboard Seeding Ѻҧʵ 䫵 webUB.com



Ѻ䫵, , ҧ䫵, Ѻ, Ѻ͡Ẻ, Ѻ¹, ͡Ẻ, 纴䫹, Ѻҧ, ¹䫵, , ѷ , ѷ ҧ, ѷ ͡Ẻ, ѷ ¹, ŧҹ, ʵ,Design,Web,, ʵ,,ʵ ҤҶ١,䫵,,ʵ,Web Download,Web PHP,Flash MX,Graphic Design,Search Engine, Web, Design, Web Host,Web Hosting,Web Page,¹,¹䫵,Ѵ,Ѵ䫵,,䫵, , ,Ѻ¹,Ѻ,Ѻ䫵,Ѻ͡Ẻ,Ѻ͡Ẻ , ٻ,纴䫹,䫵, ҧ,ҧ䫵,͡Ẻ 䫵,͡Ẻ,͡Ẻ䫵,¹,ԡʵ,Ъ ѹ,ѺѴ䫵,Ѻҧ,,, ԡèѴ䫵,ѷѺѴ䫵,ԡèѴ䫵, ջʺóèѴ䫵, ҹԡ䫵,ŧҹ䫵,ŧҹ䫵,䫵,䫵 Ѫ "§",䫵ҤҷصԸ,䫵кҵðҹ,䫵ءҹ, 䫵áԨ, ,Ъѹ,,͡Ẻ,¹,ҧ,͡ Ẻ䫵,,,¹䫵,䫵,Ѻ,Ѻ͡Ẻ ,¹,Ѻ¹,Ѻ䫵,ѺѴ䫵,ʵ, Ѵ,,䫵,纴䫹,Ѻ͡Ẻ䫵,ҧ ,,,ԡʵ,Ѵ䫵,

Ѻ䫵 : : Ѻ¹ : ͹ҧ : Domain name 299. : Hosting : ԡô䫵 : Ѻ Rolex : Sitemap.xml
ʻԧ

ͺ ѧͺ кͺ ͺ  Exam.in.th
䫵͢: SiamWebCity.com webUB.com EXAM.in.th ͺ. 觺ҹ homeEST.com
Copyright © 2009-2019 SiamWebCity.COM. ® All rights reserved. Ţ¹СͺҹԪŤ͹ԡ : 0447314800321
E-mail, Google Talk : admin [at] siamwebcity.com, Skype: SiamWebCity.com
仴ҹ