Php 为友好url配置.htaccess时出现问题

Php 为友好url配置.htaccess时出现问题,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我的.htaccess在我的网站中使用友好url时遇到问题 我的服务器结构是: www: 测试网站(网站测试代码)。 工厂测试。 .htaccess 我的店铺网站的其他文件(索引、图像等) My.htaccess具有重定向url的下一个代码 <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}

我的.htaccess在我的网站中使用友好url时遇到问题

我的服务器结构是:

  • www:
    • 测试网站(网站测试代码)。
      • 工厂测试。
        • .htaccess
        • 我的店铺网站的其他文件(索引、图像等)
  • My.htaccess具有重定向url的下一个代码

    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteEngine on
    RewriteBase /test-web/shop-test    
    RewriteRule ^pay$ index.php?section=buy [L]
    RewriteRule ^details/(.+)/?$ index.php?section=details&item=$1 [L]
    </IfModule>
    
    
    选项+FollowSymLinks
    重写cond%{REQUEST_FILENAME}-F
    重写cond%{REQUEST_FILENAME}-D
    重写cond%{REQUEST_URI}=/图标文件
    重新启动发动机
    重写基础/测试网站/车间测试
    重写规则^pay$index.php?section=buy[L]
    重写规则^details/(.+)/?$index.php?section=details&item=1[L]
    
    但如果我像下一个示例那样编写url,则不起作用:

    <a href='/test-web/shop-test/pay'>go to pay<a>
    
    去付款
    
    我尝试编写其他链接,如“/shop test/pay”,只需在我的链接中添加“pay”,并将.htaccess中的RewriteBase更改为“/shop test”或“/test web”,任何操作都可以


    我的错误是什么?

    您在
    测试网站
    中确实有什么内容吗?似乎不必要的目录。是的,我有一个测试网站(它是wordpress网站)好的,那么你的重写库和重写引擎的顺序是错误的。顺便说一句,他们需要在任何其他重写指令之前先来。还可以看看Jon关于将rewritebase与subsubdir一起使用的解释。这会让你走的。