如何将Laravel项目从index.php伪静态改为长尾词?

2026-04-01 07:291阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计283个文字,预计阅读时间需要2分钟。

如何将Laravel项目从index.php伪静态改为长尾词?

1. 首先确保Apache服务器支持`rewrite`功能。

2.在Apache配置文件中,启用`RewriteEngine`。

3.添加以下配置行到`httpd.conf`文件中:

plaintext

Listen 80RewriteEngine onLoadModule rewrite_module modules/mod_rewrite.so

1、首先,让apache服务器支持rewrite

可以在apache配置文件中定义rewrite规则,是全局的,无论哪个应用都实用

//192.168.0.222/about -->192.168.0.222/index.php/about

如何将Laravel项目从index.php伪静态改为长尾词?

</IfModule>

3、如果是专门针对laravel进行配置,则在app/app.php中加入

index=>'', //laravel4.1中没有此项,直接手写加入即可

如果还不行

先在httpd.conf注释掉

#<Directory /> # Options FollowSymLinks # AllowOverride All # Order deny,allow # Deny from all #</Directory>

然后在httpd-vhost修改如下,

<VirtualHost *:80> ServerAdmin none@none.com DocumentRoot "E:/www/learnlaravel5/public" ServerName le DirectoryIndex index.php index.html ErrorLog "logs/dummy-host.2012-20090214YX.domain-error.log" CustomLog "logs/dummy-host.2012-20090214YX.domain-access.log" common <Directory "E:/www/learnlaravel5/public"> Options -Indexes +FollowSymLinks AllowOverride all Order allow,deny Allow from all #Require all granted </Directory> </VirtualHost>

以上这篇laravel 去掉index.php伪静态的操作方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。

标签:操作

本文共计283个文字,预计阅读时间需要2分钟。

如何将Laravel项目从index.php伪静态改为长尾词?

1. 首先确保Apache服务器支持`rewrite`功能。

2.在Apache配置文件中,启用`RewriteEngine`。

3.添加以下配置行到`httpd.conf`文件中:

plaintext

Listen 80RewriteEngine onLoadModule rewrite_module modules/mod_rewrite.so

1、首先,让apache服务器支持rewrite

可以在apache配置文件中定义rewrite规则,是全局的,无论哪个应用都实用

//192.168.0.222/about -->192.168.0.222/index.php/about

如何将Laravel项目从index.php伪静态改为长尾词?

</IfModule>

3、如果是专门针对laravel进行配置,则在app/app.php中加入

index=>'', //laravel4.1中没有此项,直接手写加入即可

如果还不行

先在httpd.conf注释掉

#<Directory /> # Options FollowSymLinks # AllowOverride All # Order deny,allow # Deny from all #</Directory>

然后在httpd-vhost修改如下,

<VirtualHost *:80> ServerAdmin none@none.com DocumentRoot "E:/www/learnlaravel5/public" ServerName le DirectoryIndex index.php index.html ErrorLog "logs/dummy-host.2012-20090214YX.domain-error.log" CustomLog "logs/dummy-host.2012-20090214YX.domain-access.log" common <Directory "E:/www/learnlaravel5/public"> Options -Indexes +FollowSymLinks AllowOverride all Order allow,deny Allow from all #Require all granted </Directory> </VirtualHost>

以上这篇laravel 去掉index.php伪静态的操作方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持易盾网络。

标签:操作