本文介绍了PHP + Apache静态URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我对php很新,我想知道如何将静态网址重写为友好的网址。



例如重写:



- http://site.domain.com/ buy_products.html



- http://site.domain.com/ 购买产品







/ index.html

to

/ home



我试过这个但没有用:



Hi people,

I'm fairly new to php and I would like to know how to rewrite a static url to a friendly url.

E.g. Rewrite:

- http://site.domain.com/buy_products.html
to
- http://site.domain.com/buy-products

or

/index.html
to
/home

I tried this and did not work:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^home index.html
RewriteRule ^wine-range wine_range.html







我将非常感谢您的帮助。我用Google搜索过,我遇到的例子主要是将动态网址转换为静态网址。



问候,

Morgs




I will appreciate your help. I've googled and the examples I come across are mostly converting dynamic urls to static.

Regards,
Morgs

推荐答案


这篇关于PHP + Apache静态URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 06:59