开发者

htaccess rewrite url remove subdirectory

I'm trying to rewrite

http://www.exam开发者_StackOverflow中文版ple.com/directory/folder/*

to

http://www.example.com/directory/*

the htaccess file is in directory

this is my .htaccess file :

RewriteEngine on
RewriteBase /directory/
RewriteRule ^(.*)$ folder/$1 [L]

Any help would be much appreciated.


This is what I ended up doing :

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.*)folder 
RewriteRule ^(.*)$ folder/$1 [L]


What about this?

RewriteEngine on
RewriteRule ^folder/(.*) /directory/$1 [L]

Or you can go without [L] or use [R] instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜