在你的根目录下,创建具有以下代码的的.htaccess。这将把你所有的http请求映射到/ wp /目录。
# ==>Initializaion…
Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
# ==>Without this line, your /wp/ directory may become visible sometimes
DirectorySlash Off
# ==>Map everything to your /wp/ directory
RewriteRule (.*) /wp/$1 [L]
您还想从URL中隐藏/ wp/directoy。为此,创建你的/ wp /目录另一个的.htaccess和写入以下行:
# ==>Initializaion…
Options +FollowSymLinks
RewriteBase/
# ==>Set default file
DirectoryIndex index.php
#==> If the requested resource is NOT a file, or the URL contains “/wp/” anywhere in it,
# then serve the default file instead
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{THE_REQUEST} /wp/
RewriteRule .* index.php [L]
如果有人类型“/ WP /”,在地址栏的任何地方,他们不会看到它是什么。相反,他们会看到你的主页。
您可能需要调整代码以满足您的要求。
为什么不修改你的Codeigniter路由? – CodeGodie
你能复制和粘贴你的命令提示符'树'文件结构 - 命令在这里?这将使我们更好地了解您的目录中实际存在的内容。 – CodeGodie
是的PLZ指南,在这种情况下,我如何修改CI路由。 –