[英]How do I re-write this htaccess file?
I got this from this page: https://developers.google.com/commerce/wallet/online/quickstart-php 我是从以下页面获得的: https : //developers.google.com/commerce/wallet/online/quickstart-php
I am wondering how to re-write it to work in a subdirectory. 我想知道如何重新编写它以在子目录中工作。
like /subdirectory/index.php 像/subdirectory/index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L,NC,QSA]
Here's what you need to do: 这是您需要做的:
RewriteBase
to the name of your subdirectory 将RewriteBase
更改为子目录的名称 /index.php
从/index.php
删除前导斜杠 So say your subdirectory is called /subdir
and you have http://domain.com/subdir/index.php
, you'd have this: 因此,假设您的子目录称为/subdir
并且您拥有http://domain.com/subdir/index.php
,则将具有以下内容:
RewriteEngine On
RewriteBase /subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,NC,QSA]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.