ThinkPHP在SAE下关于url重写的问题
thinkphp。
根目录下有config.yaml(因为SAE不支持.htaccess)
内容为:
name: thinktest
version: 1
handle:
- rewrite: if(!is_dir() && !is_file() && path~"^(.*)$") goto "/index.php/$1"
- rewrite: if(path~"^/test\.html$") goto "/test.php"
关键看第二个重写。
在根目录下有test.html和test.php
访问test.html的时候可以访问到test.php
问题是
有入口文件index.php
Action里有文件IndexAction.class.php
其中index操作代码如下:
echo "";
即页面跳转。
同时在Tpl/default/Index/下有test.html和test.php
此时跳转后不会访问到test.php
不过如果是跳转到根目录下的test.html的话就没问题。
是不是跟config.yaml的作用范围有关?还是有其他原因?
求高手解答!
------解决方案--------------------
thinkphp 的伪静态是通过 PATH_INFO 实现的
唯一可能需要使用 url 重写的是: 隐藏 index.php 文件名
thinkphp 是单一入口的,所以不会出现 http://serverName/test.php 这样的 url
这一点无论是从
.htaccess 的
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
还是config.yaml的
- rewrite: if(!is_dir() && !is_file() && path~"^(.*)$") goto "index.php/$1"
都可以看出:他将域名外的所有内容都转换成了index.php的参数

LeicareleasedtheLeicaLuxcameraappfortheAppleiPhoneafewdaysago.However,theappwasnotdevelopedbyLeica,butbyFjorden.ThecompanyhasbeenknownprimarilyforitscameragripsfortheiPhoneandwasacquiredbyLeicainDecember2023.Fo

SincethedemiseofLogitech'spopularHarmonyremotecontrols,themarketforhigh-qualityuniversalremotecontrolshasbeenfragmentedatbest.UnfoldedCircleaimstoavoidthefateoftheHarmonyUltimatebyeliminatinganyserverobligationsorsubs

WhiletheLightPhone2from2018wasstillequippedwithaneconomicale-inkdisplay,theLightPhone3usesanOLEDdisplaythatcanonlydisplaygrayscale.Thereasonfortheswitchtothe3.92-inchOLEDpanelwithitsresolutionof1,240x1,080isth

In2012,theeminentautomotivejournalistJeremyClarksonstatedthattheLamborghiniAventador,whichhewasreviewingatthetime,wouldbeamongthelastcarstofeatureanaturallyaspiratedV12.Morethanadecadelater,V12-poweredsupercarsareal

TheJabraEliteserieshascometoanend,withGNCEOPeterKarlstromerannouncingthediscontinuationofthewirelessearbudswithinthelineupinapressrelease.Petersaysthatthechangingmarketdynamicsandhowchallengingithasbecometogetas

Audio-TechnicahasunveiledtheATH-S300BTwirelessheadphoneswithhear-throughnoise-cancellation,multipointpairing,and90hoursofbatterylife.Thenoise-cancellingfeaturehasthreemodes:off,on,andhear-through,whereambientsoundscanbehea

Backin2022,whenPCIe7.0wasstartingtotakeshapeasafuturestandard,PCIe5.0wasjusthittingtheservermarketsandtheprospectofseeingPCIe6.0devicesavailableanytimesoon,letalonePCIe7.0ones,wasquitefar-fetched.CurrentlyPCIe5

HisensehaslaunchedtheStarlightS1ProLaserTVinChina.TheproductwasteasedinaWeibopostearlierthismonthandwasunveiledatthe2024HisenseTVNewProductLaunchConferenceeventonJune12th.TheStarlightS1Proisa4KlaserTVinfours


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
