drwurqczo39355510 2013-08-21 03:05
浏览 29
已采纳

如何使用.htaccess从子文件夹重定向?

i have some question for you, pardon me before. I have some trouble when i want to redirect my website to another location. A url i have trying is like this :

http://localhost/mywebsite/public/example.html  => Default URL

I want to redirect my Default url to here:

http://localhost/mywebsite/example.html => What i want

My .htaccess code is :

Redirect 301 public /

im using laravel framework

  • 写回答

2条回答 默认 最新

  • duanqiu2064 2013-08-21 03:53
    关注

    Put your .htaccess file in "public" folder:

         RewriteEngine on
         RewriteRule (.*)$ /mywebsite/$1 [R=301,L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?