Php Wordpress同名页面和目录
我有根目录WordPress,我的URL看起来像 但我的目录(csgo,tf2)与WordPress中的页面具有相同的名称Php Wordpress同名页面和目录,php,wordpress,Php,Wordpress,我有根目录WordPress,我的URL看起来像 但我的目录(csgo,tf2)与WordPress中的页面具有相同的名称 ... wordpress/ ├── csgo/ │ ├── banlist/ │ ├── tf2/ │ ├── banlist/ ... 我需要在调用url时…/csgo/banlist然后重定向到文件夹../csgo/banlist 下一个问题是,当调用url…/csgo/然后加载目录,而不是wordpress页面时 但我不知道如何解决我的问题。 感谢您的回
...
wordpress/
├── csgo/
│ ├── banlist/
│
├── tf2/
│ ├── banlist/
...
我需要在调用url时…/csgo/banlist然后重定向到文件夹../csgo/banlist
下一个问题是,当调用url…/csgo/然后加载目录,而不是wordpress页面时
但我不知道如何解决我的问题。
感谢您的回复。问题已解决 在mainWordPress.htaccess中注释掉(#): 在您的目录中(在我的解决方案中是-…/csgo/banlist) 放置文件:index.php和.htaccess 将代码粘贴到文件。htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /my_wordpress/csgo/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my_wordpress/csgo/banlist/index.php [L]
</IfModule>
重新启动发动机
RewriteBase/my_wordpress/csgo/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/my_wordpress/csgo/banlist/index.php[L]
现在工作url/csgo/(wordpress页面)和/csgo/banlist(目录)问题解决了 在mainWordPress.htaccess中注释掉(#): 在您的目录中(在我的解决方案中是-…/csgo/banlist) 放置文件:index.php和.htaccess 将代码粘贴到文件。htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /my_wordpress/csgo/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /my_wordpress/csgo/banlist/index.php [L]
</IfModule>
重新启动发动机
RewriteBase/my_wordpress/csgo/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/my_wordpress/csgo/banlist/index.php[L]
现在可以使用url/csgo/(wordpress页面)和/csgo/banlist(目录)