伪静态如何做
1. 修改apache配置文件
vim /usr/local/apache2/etc/httpd.conf
//去掉前面的#号
LoadModule rewrite_module modules/mod_rewrite.so
2. 找到子配置httpd-vhosts.conf
vim /usr/local/apache2/etc/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin gzphper@163.com
DocumentRoot "/usr/local/apache2/htdocs/lamp30"
ServerName www.lamp30.com
ErrorLog "logs/dummy-host.lamp30.com-error_log"
CustomLog "logs/dummy-host.lamp30.com-access_log" common
<Directory "/usr/local/apache2//htdocs/lamp30">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
3. 去到你对应的域名的根目录
cd /usr/local/apache2/htdocs/目录
touch .htaccess
4. 编辑.htaccess
vim .htaccess
#开启重写模式
RewriteEngine On
# RewriteRule 匹配正则 就会跳到的url
RewriteRule ^(\d+).html$ 1.php?gid=$1