开发者

Converting URLs

开发者 https://www.devze.com 2023-02-24 06:45 出处:网络
UPDATE 1: Sorry, what I meant was this: I currently have the following url: http://www.companyname.com/page.php

UPDATE 1:

Sorry, what I meant was this:

I currently have the following url:

http://www.companyname.com/page.php

How can I convert that to

http://www.companyname.com/group/name

and

http://www.companyname.com/group/name/

ORIGINAL QUESTION:

I currently have th开发者_高级运维e following url:

http://www.companyname.com/page.php

How can I convert that to

http://www.companyname.com/group/page


Something along these lines:

RewriteRule ^group/page/?$ page.php

or:

RewriteRule ^group/(.+)/?$ $1.php

for other pages in this style.


I assume you want the user to see /group/page, as it is prettier.

RewriteEngine On
RewriteRule ^group/(.+)$ $1.php


There is a lot of instructions on this theme.

For example

Please URL Rewrite in php

Official documetation
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

0

精彩评论

暂无评论...
验证码 换一张
取 消