【问题标题】:remove index.php from url in laravel in ubuntu从 ubuntu 的 laravel 中的 url 中删除 index.php
【发布时间】:2014-05-15 23:08:17
【问题描述】:

我尝试了几种方法从我的 URL 中删除 index.php。

问题

网址不起作用(我想要这个):http://mysite.in/our-story

网址工作(我不想要这个):http://mysite.in/index.php/our-story

1) 我尝试启用 rewrite_mod 但它已经启用。

2) 我已尝试将此代码写入 .htaccess 文件,但问题未解决。

选项 - 多视图 重写引擎开启

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] </IfModule>

还有剩余的文件安装吗??然后告诉我?? (但我已经安装了所有东西。)

我的 000-default 文件是:

    ServerAdmin webmaster@localhost

    ServerName mydomain.in

    DocumentRoot /var/www/mysite/public
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/mysite/public/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow  Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

请给我解决方案。

谢谢朋友!!!

【问题讨论】:

  • AllowOverride 更改为all 而不是none
  • 对,先生......

标签: mod-rewrite ubuntu url-rewriting laravel


【解决方案1】:

将 AllowOverride 更改为 all 而不是 none。

杰森·刘易斯

【讨论】:

    【解决方案2】:

    检查 .htaccess 权限是否设置为 www-data(或相应的 Apache 用户)

    【讨论】:

      猜你喜欢
      • 2018-03-04
      • 1970-01-01
      • 2016-06-30
      • 2017-01-28
      • 1970-01-01
      • 2019-08-16
      • 2017-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多