2014-07-07 38 views
1

我有一个目录在我的网站:保持在URL地址的.htaccess

/new/ 

我要访问它,并重定向到的index.php这是低一级,但不希望更改地址URL,例如:

accessing: www.site.com/new/ 
check out www.site.com /index.php 
and the url remains www.site.com/new/ 

在htaccess的不能做:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteRule ^novo/*$ /index.php [NC,L] 
</IfModule> 

,他怎么能这样做?

+0

有你没有的/新目录内的index.php文件的一个原因? –

+0

但我想保持/新/并希望他去index.php,它访问,但不保持/新/ – Mourinha

+0

o/new只是一个重定向,但我想保留在url – Mourinha

回答

1

与此内容创建一个文件/new/.htaccess

RewriteEngine On  

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule^/index.php [L] 
+0

谢谢,但我的css文件不加载 – Mourinha

+0

现在尝试编辑的代码 – anubhava

+0

不加载... – Mourinha