0

I urgently need help in rewriting php URLs for my site. I have researched and tried everything but it's still not working.

I want to rewrite all the URLs in my htaccess file to rename the directory '_public' to 'art':

www.site.com/_public/work.php

so all url's show:

www.site.com/art/work.php

Can anyone help? would appreciate it very much.

4

2 回答 2

3

如果我理解正确,您希望用户转到“www.site.com/art/work.php”并显示位于“www.site.com/_public/work.php”的页面。

在 .htaccess (在根目录中)执行:

RewriteEngine on

RewriteRule ^art/(.+)$ /_public/$1 [L,QSA]

于 2012-04-24T10:51:01.240 回答
1

请在您的 htaccess 文件中添加以下行:

RewriteEngine on

RewriteRule ^art/(.+)$ /_public/$1
于 2012-04-24T10:56:14.470 回答