【问题标题】:after use RewriteRule dose not open index.php使用 RewriteRule 后未打开 index.php
【发布时间】:2020-11-05 16:57:52
【问题描述】:

使用后

RewriteRule ^([A-Za-z0-9-]+)/?$ details.php?brandname=$1

在 htaccess 文件中更改test.com/details.php?brandname=abc to test.com/abc

它不会直接在directoris中打开index.php

例如test.com/dir1它显示白页,必须输入test.com/dir/index.php才能打开

【问题讨论】:

  • 没有。我想用它。但是没有 /index.php,directoris 不会打开

标签: php indexing


【解决方案1】:

检查此代码可能会对您有所帮助。

RewriteEngine on
RewriteRule ^((?:[a-zA-Z0-9_-]|%20)+)/?$ details.php?brandname=$1

【讨论】:

    猜你喜欢
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    • 2022-11-02
    • 2014-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多