Forum Moderators: phranque

Message Too Old, No Replies

call a file from the root that's exist in a directory

         

MrBean

3:30 pm on Mar 8, 2010 (gmt 0)

10+ Year Member



Hello everyone;

I'm tring to do a little trick of redirecting but i having some problems;

so
I have a little directory on my server named newsite
there actually my site is.

I want people access those files from the root directory without knowing they actually access the newsite directory?

i tried to put that little code on the root's htaccess file but i didn't work.



### make folder phpnuke as the root of this domain ###
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /newsite/$1


thanks ahead :)
sorry for my bad English :)

jdMorgan

6:55 am on Mar 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Saying "but it didn't work" does not give us any information.

How did it "not work"? Did you get a server error? Unexpected results? Or nothing happened at all?
(If nothing happened, then you should try a very simple rule like
 RewriteRule ^test-rewriting http://www.google.com/ [R=301,L] 

to see if mod_rewrite works at all.

Jim

MrBean

9:39 am on Mar 10, 2010 (gmt 0)

10+ Year Member



Hey

first of all tank you for your answer.

by saying "it didn't work" I mean that instad of see the newsite\index.php I get the root's files and directories index.

mod_rewrite works fine i know it because in the oldsite
directory it goes very well.

do you have any idea?

jdMorgan

7:57 pm on Mar 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might try a simpler and more efficient rule to start:

RewriteEngine On
#
RewriteCond $1 !^newsite/
RewriteRule ^(.*)$ /newsite/$1 [L]

Jim