Forum Moderators: phranque

Message Too Old, No Replies

Redirect to specific file to index.php

         

Poltergeist

8:48 pm on Sep 30, 2005 (gmt 0)

10+ Year Member



Usually to redirecting a visitor from old page to new page, it can be done with redirect .htaccess command :

Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html

But it could not be used when a visitor try to open specific file via browser, let's say style.css and main.inc :


www.website.com/image/style.css
www.website.com/image/main.inc

I've done this matter in .htaccess BUT the result is very disappointing. All CSS and inc files that could not be used on my website and my website to was very bad :(

Redirect /blog/skins/gnoo/style.css http://www.example.com/blog/index.php

On JSP, its will be handled with HTTP Response, example
:


<%

response.sendRedirect( "hello.html" );

%>


or to index file

<%

response.sendRedirect( "index.php" );

%>


the visitor will be redirecting to hello.html or index.php!

BUT i don't want in JSP but in htaccess and/or PHP.

In fact, i used nucleus blog and i want all of my blog's files, (.css file, .inc file etc ..) could not be opened via browser to prevent files theft

So does anybody here perhaps know how to do it in htaccess and/or PHP?

Regards

[edited by: jdMorgan at 1:28 am (utc) on Oct. 2, 2005]
[edit reason] example.com [/edit]

mipapage

10:43 am on Oct 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is going to be impossible as the browser must download those files in order to build the page.

I'm pretty sure you just have to let your code out into the wild ;-)