English 中文(简体)
从次流中检索网页
原标题:Access webpage from subdirectory as root page

我有两个网站:

http://example.com http://example.com/sub

我要说一页:

http://example.com/sub/page1

是否有任何办法(使用......htacces)能够通过该圆顶进入1页:

http://example.com/page1?

Redirect 301 won t do the work, because I don t need redirects. Is there any way to omit /sub/ for certain urls, like http://example.com/sub/page1 ?

最佳回答

页: 1 您:

<IfModule mod_rewrite.c>
RewriteEngine On

# This would rewrite any URL that starts with /sub to /
RewriteCond %{REQUEST_URI} /sub
RewriteRule ^sub/(.*)$ /$1 [L]
<IfModule>

• 满足OP的要求。

问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签