Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I teach Apache to execute scripts with no file extension?

Status
Not open for further replies.

thedaver

IS-IT--Management
Jul 12, 2001
2,741
US
I want Apache 1.3.29 to look at this url


where /"directory"/ is the actual script to execute. How do I teach it to look for the first possible file match and execute it so that the script can use the rest of the URL as a "parameter"????

The scripting language is php.


Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 
I dont think you'll be able to.

Adding the ".php" extension would make your life alot easier. Why do you want to exclude it?
 
I want to use the common code in the "directory(.php)" file to provide a natural URL that appears to be many pages of a directory.

thus,

Appear to search engines to be three different pages - without any session or parameter strings in the URL - but they are all supported by one single instance of the "directory(.php)" script.

I know this is done lots of places, I just don't know how.


Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 
a "C" script or perhaps a perl script will allow you to run w/o an extension, but I don't think php will.
 
Try this

RewriteRule ^directory/(.*)/(.*)/(.*) /directory.php?x=$1&y=$2&z=$3

the script would be called directory.php in the root directory.
 
I forgot to say that you must have the re-write engine switched on.

RewriteEngine On

You may also need to add some settings in your <directory>

<Directory /Options ExecCGI FollowSymLinks Includes MultiViews
</Directory>
 

Or make the 'natural url' a directory and put the appropriate index.php, index.cgi, index.jsp in the directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top