.htaccess-是否可以将静态url和动态url结合使用?
目前,我使用以下代码将.htaccess文件中的动态URL转换为静态URL:.htaccess-是否可以将静态url和动态url结合使用?,.htaccess,.htaccess,目前,我使用以下代码将.htaccess文件中的动态URL转换为静态URL: RewriteRule ^([a-z0-9_\-]+)$ /index.php?page=$1 [L,NC] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?page=([^&]+)\ HTTP/ RewriteRule ^index\.php$ http://www.mywebsite.com/%1? [R=301,L] 我想知道的是,是否有可能更
RewriteRule ^([a-z0-9_\-]+)$ /index.php?page=$1 [L,NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?page=([^&]+)\ HTTP/
RewriteRule ^index\.php$ http://www.mywebsite.com/%1? [R=301,L]
我想知道的是,是否有可能更改此规则,以便可以通过
www.mywebsite.com/news
访问页面,但也可以附加额外的$\u GET
信息,例如:www.mywebsite.com/news?id=1
您想看看,在构建查询字符串后,它将附加查询字符串:
RewriteRule ^([a-z0-9_\-]+)$ /index.php?page=$1 [L,NC,QSA]
这使得它成为对http://www.mywebsite.com/news?id=1
内部重写为:/index.php?page=news&id=1