开发者

Using mod_rewrite to add a directory

I have a client which requires their site to be on:

www.clienturl.com/asubdirectory

The site that will be stored in the sub directory won't be able to have the links updated to:

www.clienturl.com/asubdirectory/a_fil开发者_JS百科e.php

They'll just be:

www.clienturl.com/a_file.php

But clicking these links would redirect or rewrite the user to:

www.clienturl.com/asubdirectory/a_file.php

Is there anything I can do with mod_rewrite and/or aliases or anythng else?

Thanks in advance guys!

Mike Pearce

Edit:

This is my current set of rewrite rules:

<IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


Try this rule:

RewriteEngine on
RewriteRule !^asubdirectory($|/) asubdirectory%{REQUEST_URI}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜