Forum Moderators: phranque

Message Too Old, No Replies

htaccess for php files

Exclude php from redirects?

         

basketmen

11:01 pm on May 17, 2007 (gmt 0)

10+ Year Member



Hi guys

because another script settings in my htaccess some php files in my root cannot read by browser

for example

www.domain.com/file1.php
www.domain.com/file2.php

what is htaccess for php files so browser can read?

another example
folder in my www.domain.com/folder1/ can not read too if i not create htaccess under that folder and using /rewritebase folder1 in the htaccess


any one can answer :D
i need this

tomda

11:11 pm on May 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmasterworld Basketmen...

Do you have an htaccess file in your main directory (www.example.com/).

If yes, then just copy and paste it here (or a short extract if it is relatively long - don't drop 100 lines of banned IP) because ten lines of code is somehow better than a long explanation.

And make sure to examplify it. That is, removing any IP address, DNS, etc. to comply with WW terms of use [webmasterworld.com]

Meanwhile, let's hope that someone else understand your problem ;)

[edited by: jdMorgan at 3:05 am (utc) on May 18, 2007]
[edit reason] Tidying-up [/edit]

basketmen

11:34 pm on May 17, 2007 (gmt 0)

10+ Year Member



no, what i am ask here just basic htaccess rule for php files

if i open these files in browser they will redirect to anoter page, i just need they not redirect and open like another normal php files

www.domain.com/file1.php
www.domain.com/file2.php

i try add this to htaccess but its not works, what is the right rule?

RewriteRule ^ file1.php
RewriteRule ^ file2.php

This is just basic i believe

jdMorgan

3:04 am on May 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, it is not a basic question. Nor is it necessarily and "easy" question. There is no "standard code for PHP."

You must have another directive somewhere that is causing this problem.

The problem will be corrected by removing or modifying that other directive.

The problem could be caused by any of the following directives:
Alias, AliasMatch, ScriptAlias, ScriptAliasMatch, Redirect, RedirectMatch, RedirectPermanent, RedirectTemp (all in mod_alias)
RewriteRule (mod_rewrite)
MultiViews (core Option)
AcceptPathInfo (core on Apache 2.x)
and possibly more...

Jim