当前位置:网站首页>The problem that only the home page can be accessed under openSUSE Apache laravel

The problem that only the home page can be accessed under openSUSE Apache laravel

2022-06-25 03:47:00 Diving rice awn

First make sure you have your own configuration file :
AllowOverride All ( instead of None)
And then because of opensuse The built-in apache2 It's optimized , It is different from the official website , We cannot modify httpd.confg, And the document also indicates that this document should not be modified .
During a visit to opensuse It was found that 2 Bar command :a2enmod a2enflag, For the time being a2enflag,a2enmod It means adding modules .
then a2enmod The modules that can be added are /usr/lib64/ Under the path

 ls apache*

All displayed mod* Are all addable modules .

a2enmod -l

To show what we have in effect mod, And then if not rewrite Add if necessary rewrite modular :

a2enmod rewrite

restart apache2 service :

systemctl restart apache2

Then check the... Under the project directory public/.htaccess Is it empty , If it is empty, add :

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
        # Options +FollowSymLinks -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{
    HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{
    HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{
    REQUEST_FILENAME} !-d
    RewriteCond %{
    REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{
    REQUEST_FILENAME} !-d
    RewriteCond %{
    REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

The above can be accessed .

a2enmod -q

Prompt that the module can be queried , But the author tried it and it seems that he can't , So I went to the corresponding directory to find the module .

原网站

版权声明
本文为[Diving rice awn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210538445596.html