【问题标题】:URL redirection wampURL 重定向 wamp
【发布时间】:2013-11-02 23:41:33
【问题描述】:

我正在尝试重定向我的 Zend 项目的 URL,如下所示:

我可以这样访问我的页面:

http://senderboard/index.php/en/dashboard

但我想要做的是重定向到与此 URL 相同的页面: http://senderboard/en/dashboard

我可以做这个重定向吗?

我认为我的 VirtualHost 配置中需要添加一些内容:

<VirtualHost *:80>
ServerName senderboard
DocumentRoot /wamp/www/trunk/public
SetEnv APPLICATION_ENV "development"

<Directory /wamp/www/trunk/public>
    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

谢谢!

【问题讨论】:

    标签: php apache wamp virtualhost


    【解决方案1】:

    您可以使用mod_rewrite 来执行此操作。在您的VirtualHost 中,这样的事情可能会奏效。

    RewriteEngine on        
    RewriteCond %{REQUEST_URI} !^/index\.php
    RewriteRule ^(.*) /index.php$1 [QSA,L]
    

    确保您已启用mod_rewrite

    希望它可以帮助您前进。

    【讨论】:

    • 谢谢你,我只是忘了启用 mod_rewrite
    猜你喜欢
    • 1970-01-01
    • 2014-05-05
    • 1970-01-01
    • 2018-06-11
    • 2016-02-06
    • 2015-01-01
    • 2016-10-06
    • 2019-09-15
    • 2018-12-30
    相关资源
    最近更新 更多