In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article uses easy-to-understand examples to introduce how to add pseudo-static rules to the virtual host, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Pseudo-static is relatively real static, usually in order to enhance the friendly side of the search engine, the article content is generated into a static page, but some friends in order to display some information in real time. Or you may want to use dynamic scripts to solve some problems. The content of the site cannot be displayed in a static way. But this loses its friendliness to search engines. How to find an intermediate method between the two, which leads to pseudo-static technology. What is shown is in the form of static pages such as html, but it is actually handled by dynamic scripts such as ASP.
First, pseudo-static configuration rules of virtual host in Linux system
Linux virtual host, you need to modify the .htaccess file in the root directory to achieve pseudo-static. If there is no .htaccess, you can create a new text document and rename it to .htaccess. The pseudo-static rules for the .htaccess file configuration are as follows:
RewriteEngine onRewriteRule ^ (/? html/.*?) $/ gourl.php?url=$1 [L] RewriteRule ^ (/? list/cate/.*?) $/ gourl.php?url=$1 [L] RewriteRule ^ (/? news/detail/.*?) $/ gourl.php?url=$1 [L] RewriteRule ^ (/ jourmy/cn/html/.*?) $/ gourl.php?url=$1 [L]
Second, pseudo-static configuration rules of virtual host in Windows system
Windows virtual host, whose configuration file is usually web.config, finds the file in the root directory and adds pseudo-static rules:
What if I use WordPress to build a website?
Most WordPress sites use the Linux system, so the first method above applies to WordPress type sites.
Of course, we can also directly use the built-in features of WordPress to achieve pseudo-static configuration, such as simply explaining it by setting the IDC knowledge base.
Log in to the WordPress management backend. Under "Settings"-"fixed link", there are:
Default plain settings, date and name type, month and name type, number type, article name, custom structure.
We use a custom structure. After the link, add /% post_id%.html to represent the article link using the article ID as the link, and all articles are in the / docs/ directory.
At this point, it's not over, you also need to configure the .htaccess file. Put the following code into the .htaccess file:
RewriteEngine OnRewriteBase / docs/RewriteRule ^ index\ .php $- [L] RewriteCond% {REQUEST_FILENAME}!-fRewriteCond% {REQUEST_FILENAME}!-dRewriteRule. / docs/index.php [L]
From then on, your pseudo-static rules will take effect, otherwise the page will become 404. Note that you need to define the docs directory in the. Htaccess file.
On the virtual host how to add pseudo-static rules to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.