Php 使用htaccess重定向到*页
我正在使用一个名为“onedrive/example/”的目录 在dir示例中,存储了我的所有php文件 现在我想使用htaccess重定向如下: 当有人试图访问htaccess时,需要将用户重定向到 但我该如何创造呢?我已经试过了:Php 使用htaccess重定向到*页,php,.htaccess,mod-rewrite,redirect,Php,.htaccess,Mod Rewrite,Redirect,我正在使用一个名为“onedrive/example/”的目录 在dir示例中,存储了我的所有php文件 现在我想使用htaccess重定向如下: 当有人试图访问htaccess时,需要将用户重定向到 但我该如何创造呢?我已经试过了: Options +FollowSymLinks RewriteEngine on php_flag session.bug_compat_42 0 php_flag session.bug_compat_warn 0 php_value memory_lim
Options +FollowSymLinks
RewriteEngine on
php_flag session.bug_compat_42 0
php_flag session.bug_compat_warn 0
php_value memory_limit 64M
RewriteRule ^onedrive-redirect/(.*)/ ./onedrive/example/$1.php
RewriteRule ^onedrive-redirect/(.*) ./onedrive/example/$1.php
但是这个例子不适合我。有人能帮我让它工作吗?您可以在
文档中使用此代码。\u ROOT/.htaccess
文件(onedrive
的父目录):
RewriteEngine On
RewriteBase /
RewriteRule ^onedrive-redirect(/.*)$ /onedrive/example$1 [L,NC]