OfirH
OfirH

Reputation: 657

url-rewriting - set default web-site path

How can I set a default path for files?

What i mean that if i have this address for exapmle: http://www.mysite.com/example/example2 for the file example.php.

And I have include function in example.php. lets say, include('a.php');

Its looking for http://www.mysite.com/example/example2/a.php. I need it to look for http://www.mysite.com/a.php

Thank you!

Upvotes: 0

Views: 51

Answers (2)

Hardik Panseriya
Hardik Panseriya

Reputation: 523

Add below code in .htaccess file

<IfModule mod_rewrite.c>

    RewriteEngine on

    Options +FollowSymLinks

    RewriteRule ^(.*)$ example/example2/a.php

</IfModule>

Upvotes: 2

anubhava
anubhava

Reputation: 785481

You can add this line in your DOCUMENT_ROOT/.htaccess:

php_value include_path "/full/path/to/Document/Root:."

to set include path that will let you include file as include('a.php');

Upvotes: 0

Related Questions