![](/img/trans.png)
[英]How do I tell the index of my subdomain to call the entire contents of the root directory in the index.php file of my sub-directory?
[英]The htaccess file in my root is redirecting my wordpress site in my /apply/ directory to my root index. Help! :\
我的域名是https://domainremoved.com/ 。 我在站点上安装了一些新软件,并且需要启用mod_rewrite。 它已经在服务器上启用,但被告知我还必须将其包含在htaccess文件中。 我还需要在我的wordpress博客最初所在的网站的根目录中安装该软件。 因此,我将Wordpress博客移至新目录,并将其命名为/ apply。 一切正常,直到我通过将其添加到htaccess根文件中启用了mod_rewrite为止:
DirectoryIndex router.php
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 ^(.*)$
RewriteRule ^(.*)$ router.php?_doroute=$1 [L,QSA]
现在,转到我的Wordpress目录将重定向到我的根页面。 请帮忙 :\\
另外, 请访问https://domainremoved.com/apply/contact-page/和其他页面。
这是我的Wordpress目录中的htaccess文件信息(/应用):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /apply/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /apply/index.php [L]
</IfModule>
# END WordPress
我想通了,感谢上帝! 我只需要将/apply/index.php添加到.htaccess文件。 这是现在的样子:
DirectoryIndex router.php /apply/index.php
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 ^(.*)$
RewriteRule ^(.*)$ router.php?_doroute=$1 [L,QSA]
感谢大家!
尝试删除第三个重写条件,然后清除浏览器缓存。
将根目录中的.htaccess更改为:
DirectoryIndex router.php
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ router.php?_doroute=$1 [L,QSA]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.