Remove the index.php from the URLThe usual URL contains index.php, in order to achieve a better SEO effect may need to remove the URL inside the index.php, through the way of URL rewriting can achieve this effect, usually need to open the Server Url_rewrite module to support.For example, the original URL is:http://127.0.0.1/index.php/index/insertAfter removing the index.php, it becomes:http://127.0.0.1/index/insertStep one: Change the Apache httpd.conf configuration file1. Confirm that the Mod_r
internal sub-request) is only used for internal sub-requestsNC (no case) is not casing-sensitiveOne) QSA (query string append) Append request stringNE (no URI escaping of output) does not escape special characters in the outputFor example: rewriterule/foo/(. *)/bar?arg=p1%3d$1 [R,ne] will be able to correctly convert/foo/zoo to/bar?arg=p1=zooPT (pass through to next handler) is passed to the next processingFor example:Rewriterule ^/abc (. *)/def$1 [P
Recently found that many customers use the Western Digital construction Station assistant to build the site environment, the Western Digital very early launch of the construction station Assistant software, now is 4.0 version, the software in China is more mature.
A lot of webmaster still don't understand this construction station assistant pseudo static How to set, in fact very simple, in the Site Settings window can choose more commonly used pseudo static rules, or custom pseudo static.
incorrectly, so pay attention to this.3. If the access format is http: // localhost/daixiaorui/, do not add "RewriteBase/". "RewriteBase/" indicates defining the root path. In this case, either comment this sentence or change it to "RewriteBase/daixiaorui /".Check whether the writing rules are correct. The following is an example of the homepage and article page for your reference:RewriteEngine On# RewriteBase/RewriteRule ^ index \. html $ index \. php [L]RewriteRu
(. *)/def $1 [PT]Alias/def/ghiIf the PT tag is omitted, although the uri =/abc /... Rewrite to filename =/def /... But the subsequent mod_alias attempts to convert the URI to the file name will fail.Note: If you need to use multiple modules to convert URIs to file names, you must use this tag .. The mixed use of mod_alias and mod_rewrite is a typical example."Qsappend | QSA" (append query string)This flag forces the rewrite engine to append
Apache Rewrite needs to be enabled by default.There are two types of Rewrite configurations in Apache. One is for the configuration of the entire apache server. The Rewrite rules for this configuration are directly written under httpd. conf. The configuration steps are as follows:(1) remove the "# LoadModule rewrite_module modules/mod_rewrite.so" # "in the httpd. conf file;(2) then write the following rules in httpd. conf:RewriteEngine onWhen starting a file ending with ".htm
How to implement a php framework article series [4] url routing management directly accesses functions ($ act) in the controller ($ ctl) of the business module ($ app) through url parameters)
We support three routing modes
Normal mode
_ A = $ app, _ u = $ ctl. $ act
The simplest way is to focus on implementing the business $ act function without writing additional code.
Why do we need to underline the parameter name?
Easy Mode
_ Easy = $ app. $ tpl. $ ctl. $ act
_ Easy = $ a
GoWeb Programming PHP website version: PHP-For-Go-Web parses the md file of Go Web programming with php + bootstrap3. Build a local or remote website. Mom no longer needs to worry about my network speed.
Getting md files from https://github.com/astaxie/build-web-application-with-golang/tree/master/zh
PHP parsing class library for retrieving Markdown format data from https://github.com/erusev/parsedown
Use PHP to parse html data
Use Bootstrap to display the final html page
I don't p
parameter indicates the operation.In the PATHINFO mode, URLs can be customized. for example, you can use the following configuration:
'URL _ PATHINFO_DEPR '=>'-', // modify the PATHINFO parameter delimiter
We can also support the following URL access:
Http: // localhost/app/index. php/module-action-var-value/
REWRITE mode: This mode adds support for REWRITE rules based on the PATHINFO mode. you can remove the entry file index. php in the URL address, but you need to configure additional R
where index. php needs to be hidden (E:/html/myapp in this tutorial, that is, the directory where the entry file is located ).
File and write the following rule code:
RewriteEngine
On
# Do not display index. php
RewriteCond % {REQUEST_FILENAME}
! -D
RewriteCond % {REQUEST_FILENAME }! -F
RewriteRule ^ (. *) $ index. php/$1
[QSA, PT, L]
If the website already has. htaccess
File to add the configuration rules for
Thinkphp One of the lessons: Deployment directory
Introduction to thinkphp Project deployment:
In order to improve the security of the site, the system directory and the project directory can be placed under the non- WEB access directory, the site directory only need to place public directory and portal files.
such as (personal ideas to share to everyone, enthusiastic to speak, learn from each other!! ):
Another two small and practical cutting necessary technology, hehe, look at the thinkphp
All I wanted was to get rid of the index.php in the URL path.
The first is the configuration. htaccess
Rewriteengine Onrewritecond%{request_filename}!-drewritecond%{request_filename}!-fRewriteRule ^ (. *) $ index.php/$1 [Qsa,pt,l]
Because I'm deploying on Apache, I need to find LoadModule rewrite_module in httpd.conf config file modules/mod_rewrite.so remove the previous #, find allowoverride None changes to allowoverride all.
Now ac
There are two requirements.
1.http Auto Jump HTTPS
2.index.php Shield off, thinkphp frame.
Thanks
Reply content:
There are two requirements.1.http Auto Jump HTTPS2.index.php Shield off, thinkphp frame.
Thanks
It is recommended to view related documents. Http://www.htaccesseditor.com/sc.shtml provides a web that can be generated online.
Add: HTTP://HI.BAIDU.COM/HONFEI/ITEM/0893A6E12984903A4DDCAFBC
One, HTTP jumps directly to HTTPS
RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteR
Thinkphpnotfound cannot use urlrewriteNotFoundTherequestedURL/personnel/testwasnotfoundonthisserver. if the server is APA thinkphp not found, you cannot use urlrewrite.
Not Found
The requested URL/personnel/test was not found on this server.
The server is APACEH.
[Tue Jun 21 10:19:18 2011] [error] [client 127.0.0.1] File does not exist: D:/work3/personnel/test
?
?
Solution
This error mainly occurs when processing php url rewriting. this can be handled in the official manual.
?
Usually, index. p
On the apache server rewrite, my goal is to enter the url: localhostprojectShortURLindex. php149Ui3 in the address bar and automatically rewrite it to localhostprojectShortURLindex. php? Controllerjump amp; methodjemp amp; code149U about apache server rewrite
My purpose is to enter the url in the address bar:
Http: // localhost/project/URLs/index. php/149Ui3
Automatically rewrite
Http: // localhost/project/dynamic URL/index. php? Controller = jump method = jemp code = 149Ui3
Add the fol
ThinkPHP implements URLrewrite. if you want to use ThinkPHP to implement URL nbsp; rewrite, the project's "hello" directory structure is as follows: localhosthelloindex. phpUserlogin. This link is fine. LocalhosthelloUserlogin, this link is not allowed. L ThinkPHP implements URL rewrite
To implement URL rewrite using ThinkPHP, the directory structure of project hello is as follows:
Http: // localhost/hello/index. php/User/login. This link is acceptable.
Http: // localhost/hello/User/login, th
Wampserver Configuring Pseudo-statichttpd.conf fileSearch Find "LoadModule rewrite_module modules/mod_rewrite.so" This line, remove the previous "#";Search Find "LoadModule rewrite_module modules/mod_rewrite.so" This line, remove the previous "#";Create a new. haccess file, put it in the root of the current Web site, and add a pseudo-static rule to the. haccess fileOptions +followsymlinksRewriteengine onRewritecond%{request_filename}!-dRewritecond%{request_filename}!-fRewriterule ^ (. *) $ index
alias,scriptalias (from the URI to the file name). Redirect and other instructions for subsequent processing [Original: Thisflagisjustahacktoenablepost-processingoftheoutputofrewriteruledirectives,usingalias, Scriptalias,redirect,andotherdirectivesfromvariousuri-to-filenametranslators.]. Give an example of what it means: if you want to rewrite/abc to/def, and then use Mod_alias to convert/def to/ghi, you can:
REWRITERULE^/ABC (. *)/DEF$1[PT]
Alias/def/ghi
If the PT mark is omitted, though the u
CodeWe can also support the following URL access:http://localhost/app/index.php/module-action-var-value/Copy CodeRewrite mode: is based on the PathInfo mode to add the support of rewrite rules, you can remove the URL address inside the entry file index.php, but need to configure additional Web server rewrite rules.If it is Apache, you will need to add the. htaccess file to the sibling of the portal file with the following content:
Rewriteengine Onrewritecond%{request_filename}!-drew
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.