【问题标题】:HtAccess Laravel访问 Laravel
【发布时间】:2018-03-05 13:53:16
【问题描述】:

请在下面找到我的 Laravel 网站 URL:www.webrox.ae

这个网站的问题是......它打开 /index.php 并且对于所有菜单项,如投资组合或雇用我们等,它打开 name/oservices/public/portfolio.. 像这样的东西,......

下面是我的 htaccess 文件

请指导

#Alternate default index page
    DirectoryIndex www.webrox.ae/index.php
    # BlueHost.com 
    # .htaccess main domain to subdirectory redirect 
    # Do not change this line. 
    RewriteEngine on 
    # Change example.com to be your main domain. 
    # Change 'subdirectory' to be the directory you will use for your main domain. 
    # Don't change the following two lines. 
    # Change 'subdirectory' to be the directory you will use for your main domain. 
    RewriteCond %{HTTP_HOST} ^(www.)?webrox.ae$ 
    RewriteCond %{REQUEST_URI} !^/oservice/public/ 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /oservice/public/$1 
    # Change example.com to be your main domain again. 
    # Change 'subdirectory' to be the directory you will use for your main domain 
    # followed by / then the main file for your site, index.php, index.html, etc. 
    RewriteCond %{HTTP_HOST} ^(www.)?webrox.ae$ 
    RewriteRule ^(/)?$ webrox.ae/index.php [L]
    RewriteCond %{HTTP_HOST} ^www\.webrox\.ae$
    RewriteRule ^/?$ "http\:\/\/webrox\.ae\/" [R=301,L]

谢谢

【问题讨论】:

  • 你能分享一下你是如何在你的主页中使用anchor标签()的href属性
  • 你的意思是index.php吗?它是一个 lravel,所以请说出你在说哪条路
  • 从 DirectoryIndex 中删除 /index.php 后尝试。默认情况下需要。我不确定,但你可以试试
  • 尝试创建你的bolg时生成的默认htaccess

标签: laravel .htaccess


【解决方案1】:

换行

RewriteCond %{REQUEST_URI} !^/oservice/public/ 
RewriteRule ^(/)?$ webrox.ae/index.php [L]

RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^(/)?$ webrox.ae [L]

并添加行

RewriteRule ^ index.php [L]

【讨论】:

    猜你喜欢
    • 2013-02-08
    • 2021-07-04
    • 2013-11-20
    • 2018-12-06
    • 2018-08-29
    • 2019-01-29
    • 2020-02-10
    • 2018-02-10
    • 2016-07-08
    相关资源
    最近更新 更多