繁体   English   中英

如何使用.htaccess启动时调用index.php?

[英]how to call index.php on startup with .htaccess?

我在周围搜索..但未找到solution.so,所以我发布了这个问题。
我有一个.htaccess我正在尝试重定向index.php网站。
例如:当用户键入demo.org/demo2/ URL重定向到demo.org/demo2/index.php 注意index.phpdemo2目录中。

.htaccess file:

DirectoryIndex index.php index.html index.htm
php_value memory_limit 200M
php_value upload_max_filesize 200M
php_value post_max_size 200M  

问题是网址未重定向。 提前致谢。

您会想要一些符合以下条件的东西

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^/demo2/?$
    RewriteRule ^$ http://demo.org/demo2/index.php [L,R=301]
</IfModule>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM