开发者

.htaccess help, replacing URI segment

I have a URL that looks like this...

http://www.domain/a/var

I am hoping it would be possible to rewrite the URL using .htaccess so that /a/ would be replaced by /b/.

Is开发者_如何学编程 that possible, and if so, how?


RewriteEngine On

RewriteRule ^a/(.*) /b/$1


This should do that you need

RewriteEngine on
RewriteRule ^/a/(.*) /b/$1

Note: You'll need to add [PT] or similar if you need mod_alias or mod_index or similar to work using the new path.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜