<p>For different servers and virtual spaces, the environment for running PHP is also different, currently mainly divided into: Nginx, apache, IIS and other servers. Here's how to remove the index. PHP character from the URL. Remember to restart the server and clear the cache in the management background.</p><p>[IIS Server]</p><p>There is a web. config file in the root directory of the website. The function of this file is to rewrite the URL, make the URL short, easy to optimize by SEO, and the user's memory. Open the web. config file and add the following code fragments on the original basis.</p><p><rewrite></p><p><rules></p><p><rule name= "Imported Rule 1" enabled= "true" stopProcessing= "true"></p><p><match url="^(. *)$"/></p><p><conditions logicalGrouping="MatchAll"></p><p><add input="{HTTP_HOST}" pattern="^(. *)$"/>"</p><p><add input="{REQUEST_FILENAME}" matchType= "IsFile" negate= "true"/></p><p><add input="{REQUEST_FILENAME}" matchType= "IsDirectory" negate= "true"/></p><p></conditions></p><p><action type="Rewrite" url="index.php/{R:1}"/></p><p></rule></p><p></rules></p><p></rewrite></p><p>The following is the effect of a Hong Kong virtual space:</p><p><? XML version = "1.0" encoding = "UTF-8"?></p><p><configuration></p><p><system.webServer></p><p><handlers></p><p><remove name="PHP-7.0-7i24.com"/></p><p><remove name="PHP-5.6-7i24.com"/></p><p><remove name="PHP-5.5-7i24.com"/></p><p><remove name="PHP-5.4-7i24.com"/></p><p><remove name="PHP-5.3-7i24.com"/></p><p><remove name="PHP-5.2-7i24.com"/></p><p><add name="PHP-5.4-7i24.com" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="c:php.4php-cgi.exe" resourceType="Either"/></p><p></handlers></p><p><rewrite></p><p><rules></p><p><rule name= "Imported Rule 1" enabled= "true" stopProcessing= "true"></p><p><match url="^(. *)$"/></p><p><conditions logicalGrouping="MatchAll"></p><p><add input="{HTTP_HOST}" pattern="^(. *)$"/>"</p><p><add input="{REQUEST_FILENAME}" matchType= "IsFile" negate= "true"/></p><p><add input="{REQUEST_FILENAME}" matchType= "IsDirectory" negate= "true"/></p><p></conditions></p><p><action type="Rewrite" url="index.php/{R:1}"/></p><p></rule></p><p></rules></p><p></rewrite></p><p></system.webServer></p><p></configuration></p><p>[Nginx Server]</p><p>Add the following code fragments to the original nginx rewrite file:</p><p>Location / {</p><p>If (!-e $request_filename) {</p><p>Rewrite ^(. *)$/ index. php? S=/$1 last;</p><p>Break;</p><p>}</p><p>}</p><p>[apache server]</p><p>Yiyou CMS automatically hides index. PHP entries by default in Apache server environment.</p><p>If no hiding is found, you can check whether the root directory. htaccess contains the following code snippets:</p><p><IfModule mod_rewrite.c></p><p>Options + FollowSymlinks - Multiviews</p><p>RewriteEngine on</p><p>RewriteCond%{REQUEST_FILENAME}!-d</p><p>RewriteCond%{REQUEST_FILENAME}!-f</p><p>RewriteRule ^(*)$index.php/$1 [QSA, PT, L]</p><p></IfModule></p><p>If it exists, go ahead and see if Apache has opened the URL rewrite_module and restart the service.</p><p><br/></p>
CONTACT
联系重庆狐灵网络科技有限公司
苏州服务咨询信息已同步到当前分站,便于搜索引擎和 AI 问答识别真实联系入口。