Description of. htaccess syntax parameters. Contact. friends of htaccess files do not understand some of the opposite syntaxes. They often see a rule followed by some capitalized publish QSA or something. do they know what they mean. do friends of the htaccess file have some opposite syntaxes that are not very well understood? I often see a rule followed by some capitalized L NC R QSA or something. do you k
The purpose is to display a Url such as test. comfrontindex in the mobile phone version as test. commfrontindex. the actual link should be test. comfrontindex? Modem: amp; lt; IfModu... the Rewrite in the Test environment is written in the following way:
Display as http://test.com/m/front/index on phone
The actual link should be http://test.com/front/index? Mode = m
Now, the Rewrite in the Test environment is written as follows:
Options + FollowSymlinks
RewriteEngine On
RewriteCond % {
WWW.DOMAIN2.COM/CONTACT/?SESSIONID=66543AFE6543ASDF6ASD and this url:http://www.domain2.com/-66543afe6543asdf6asd-/ Contact/?email=yes became like this: HTTP://WWW.DOMAIN2.COM/CONTACT/?EMAIL=YESAMP;SESSIONID=66543AFE6543ASDF6ASD to achieve it, Simply configure two virtual servers as domain1 and Domain2, as follows:
documentroot/usr/local/www/domain1 ServerName www.domain1.com rewriteengine on Rewriterule ^/-(. *)-(. *?). *) $ $2sessionid=$1 [L,R,QSA
ThinkPHP3 simple settings for pseudo-static and URL rewrite multiple matches
Configure Apacheaccording to the section of the ThinkPHP3.0 manual URL rewrite.
Then place the . htaccess file in the root directory of the Web site, as indicated in the manual
Win2003 Space IIS6 does not support the. htaccess, choose the server of the Linux system as much as possible
?
Rewriteengine Onrewritecond%{request_filename}!-drewritecond%{request_filename}!-fRewriteRule ^ (. *) $ index.php/$1 [
it to use! Step 3: Configure Apache now, the remaining step is to configure apache to override this URL: the http://www.domain2.com/-66543afe6543asdf6asd-/contact/ becomes like this: http://www.domain2.com/contact? Sessionid = 66543afe6543asdf6asd and this url: http://www.domain2.com/-66543afe6543asdf6asd-/contact? Email = yes becomes like this: http://www.domain2.com/contact? Email = yes sessionid = 66543afe6543asdf6asd in order to implement it, simply configure two virtual servers as domain1
Thinkphp Upload error solution: click to enter the second-level page error nbsp; modify. htaccess file, replace RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L] with RewriteRule ^ (. *) $ index. php/$1 [QSA] the home page cannot be opened, folder case sensitivity issues, HiChina server thinkphp Upload error solution
Click to go to the second-level page and modify the. htaccess file,
Replace RewriteRule ^
Simple settings for multiple matching of ThinkPHP3 pseudo-static and URL rewriting configure Apache according to the section in the ThinkPHP3.0 manual URL rewriting. Then, put the. htaccess file in the root directory of the website. The content is as prompted in the manual. iis6 in win2003 does not support. htaccess. how can I use a linux server? Lt; simple setting for multiple matches of IfMo ThinkPHP3 pseudo-static and URL rewriting
Configure Apache according to the section rewritten by Thi
. If my entire site is placed in, www/this site root directory, may not have this problem. But there should be a solution at this time, right? Amount
It depends on your site directory settings.
It depends on your site directory settings. What do you mean? How to set AH. Rewritebase/echoIs this it?
Assign a URL to the echo in the. htaccess of the Web site root directoryRewriterule ^ (/?) (. *) $/echo/$2 [pt,l]In the Echo directory. htaccess do project mappingRewriterule ^ (. *) $ index.php/$1
1.Configuring the URL pattern in the project configuration file (\application\common\conf\config.php)1 5 ' url_router_on ' = = true,//default Fllse,//Whether URL routing is turned on6);Add the contents of the. htaccess file as follows:Rewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index. php/$1 [Qsa,pt,l]If you want to hide the admin.php backstage entry, add the following linesRewriterule
this URL.
We need to
http://www.domain2.com/-66543afe6543asdf6asd-/contact/
Become this:
Http://www.domain2.com/contact/?sessionid=66543afe6543asdf6asd
And this URL:
Http://www.domain2.com/-66543afe6543asdf6asd-/contact/?email=yes
Become this:
Http://www.domain2.com/contact/?email=yessessionid=66543afe6543asdf6asd
To achieve the above requirements, simply configure two virtual servers as domain1 and Domain2, as follows:
Documentroot/usr/local/www/domain1
ServerName www.domain1.com
Rewriteengine
code above will produce the following output:
Click
Here SessionID has been inserted into the URL.
Step Three: Configure Apache
Now, we're going to configure Apache to rewrite this URL.
We need to
http://www.domain2.com/-66543afe6543asdf6asd-/contact/
Become this:
Http://www.domain2.com/contact/?sessionid=66543afe6543asdf6asd
And this URL:
Http://www.domain2.com/-66543afe6543asdf6asd-/contact/?email=yes
Become this:
Http://www.domain2.com/contact/?email=yessessionid=66543afe6543asdf6asd
T
suffix name linkIf you want to make the link to your PHP site more concise and easy to remember-or to hide the file's suffix name, try this:
Rewriterule ^/? ([a-z]+) $ $1.php [L]
If the site is mixed with PHP and HTML files, you can use Rewritecond to determine if the suffix file exists, and then replace it:
Rewritecond%{request_filename}.php-f
Rewriterule ^/? ([a-za-z0-9]+) $ $1.php [L]
Rewritecond%{request_filename}.html-f
Rewriterule ^/? ([a-za-z0-9]+) $ $1.html [L]
If the file is suffixed w
the file is a. php suffix, this rule will be executed.
9. Examine specific parameters in a query variableIf you have a special parameter in the URL, you can use Rewritecond to identify whether it exists:
Copy Code code as follows:
Rewritecond%{query_string}!uniquekey=
Rewriterule ^/?script_that_requires_uniquekey\.php$ other_script.php [qsa,l]
The rules above will check for the existence of the UniqueKey parameter in {query_strin
is to match the Id class name wildcard label name// 1 2 3 4Var rbaseselector =/^ (? : # ([\ W \-] +) | \. ([\ w \-] +) | (\ *) | (\ w +) $ /;// Basic function, support object, verify qsa and byclassVar support = {};// An attribute in the basic function is essentially used to check whether this method exists in the system (using regular expressions to determine)Support. qsa = rnative. test (document. queryS
:
$ Domains ['domain1'] = "http://www.domain1.com/-?sessionid -";$ Domains ['domain2'] = "http://www.domain2.com/-?sessionid -";?>
Let's write the following code:
Echo "Click ?>
The above code will generate the following output:
Click
Here, sessionid has been inserted into the URL.Step 3: Configure ApacheNow, configure Apache to rewrite this URL.We needHttp://www.domain2
Why is enabling REWRITE mode ineffective? Http: // localhost/app/index. php/Login in the address bar, you can enter a webpage
Http: // localhost/app/. in this way, the webpage cannot be found and the address bar is changed to http: // localhost/app/Login.
Enter http: // localhost/app/index. php/Login to display the webpage
PHP version 5.5 ThinkPHP version 3.12
The content in. htaccess is:
RewriteEngine on
RewriteCond % {REQUEST_FILENAME }! -D
RewriteCond % {REQUEST_FILENAME }! -F
Re
results: the final result of the matched part. If results is not assigned a value, an empty array is assigned. * @ Param seed initial set */function Sizzle (selector, context, results, seed) {var match, elem, m, nodeType, // QSA varsi, groups, old, nid, newContext, newSelector;/** preferredDoc = optional values Doc ument ** setDocument method to complete some initialization work */if (context? Context. ownerDocument | context: preferredDoc )! = Docum
/-66543afe6543asdf6asd-/contact/The result is as follows:Http://www.domain2.com/contact? Sessionid = 66543afe6543asdf6asdAnd this url:Http://www.domain2.com/-66543afe6543asdf6asd-/contact? Email = yesThe result is as follows:Http://www.domain2.com/contact? Email = yes sessionid = 66543afe6543asdf6asdTo meet the preceding requirements, simply configure two virtual servers as domain1 and domain2. The following operations are performed:DocumentRoot/usr/local/www/domain1ServerName www.domain1.comRe
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.