Mourinha
Mourinha

Reputation: 49

Keep the address in the url .htaccess

I have a directory on my site:

/new/

I want to access it and redirect to index.php which is one level below, but do not want the address change url, example:

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

In htaccess could not do:

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

How could he do?

Upvotes: 1

Views: 53

Answers (1)

anubhava
anubhava

Reputation: 785406

Create a file /new/.htaccess with this content:

RewriteEngine On    

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

Upvotes: 1

Related Questions