| | |
Running PHP files without .php extension
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
••••Originally Posted by xarzthis might be a little bit different from what you want but you can place an index.php file inside myhost/docs/default and place a code index.php which will redirect you to any page that you wish in this case default.php••••Originally Posted by jbennetor just add default.php to the default document list along with index.php etc...••••Originally Posted by xarzor use the include("default.php") inside index.php
http://www.mediawiki.org/wiki/Manual
hort_URLThe link has according to the preview being replaced with a smily so I have also placed the above link in the codebox below:
PHP Syntax (Toggle Plain Text)
http://www.mediawiki.org/wiki/Manual:Short_URL
And those rules as they are called are:
PHP Syntax (Toggle Plain Text)
Alias /wiki /path/to/your/wiki/index.php Alias /wiki /var/www/w/index.php
PHP Syntax (Toggle Plain Text)
RewriteEngine On RewriteRule ^default$ default.php
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
•
•
Join Date: Oct 2008
Posts: 20
Reputation:
Solved Threads: 0
•
•
•
•
what webserver are you using?
just configure it as a default document.
I have set "index.php" as default document but that does not solve my problem
I want to run php files without .php extension.
For eg:-
"myhost/docs/index"
should run "index.php"
If you are using Xampp then you will need to enable the rewrite module in the apache httpd.conf file to use the .htaccess files(located C:/xampp/apache/conf/httpd.conf). To do this, first create a copy of the file located C:/xampp/apache/conf/httpd.conf or relative to your installation folder then open the original in notepad. After opening it in notepad, search for the term "LoadModule rewrite_module" without the quotes and when you find it, remove the hash at the beginning of the line. Then search for "AllowOverride None" without the quotes and at least twice will be found and need replacing with "AllowOverride All" (without the quotes). Then save the file and you should be able to use .htacess files. Another set of instructions just reworded of what I have said can be found at http://www.knowledgebase-script.com/...ticle-599.html
You may wonder how I know this, because I also have Xampp. Also when renaming a text file to ".htaccess", you may find that to be impossible to do due to a windows explorer error bug so just open notepad and save the file as ".htaccess" and that will create the file.
Also if it is all files you want to not have the extension use the following code in the .htaccess file.
You may wonder how I know this, because I also have Xampp. Also when renaming a text file to ".htaccess", you may find that to be impossible to do due to a windows explorer error bug so just open notepad and save the file as ".htaccess" and that will create the file.
Also if it is all files you want to not have the extension use the following code in the .htaccess file.
PHP Syntax (Toggle Plain Text)
RewriteEngine On RewriteRule ^([^.]+)$ $1.php
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
•
•
Join Date: Nov 2008
Posts: 15
Reputation:
Solved Threads: 1
Give this a whirl -
PHP Syntax (Toggle Plain Text)
RewriteEngine On RewriteBase / RewriteRule ^()$ index.php [NC,L] Rewritecond %{REQUEST_URI} !(^/?.*\..*$) [NC] RewriteRule (.*)$ $1.php [NC]
![]() |
Similar Threads
- Problem with PDFLib (PHP)
- php5 and phpmyadmin?? (PHP)
- Apache (Linux Servers and Apache)
- missing php folder (PHP)
- problem in running (PHP)
- problem in running scripts (PHP)
- can we download files from other websites using php (PHP)
- 7 Tips to Keep your PC Running At Peak Performance (Windows tips 'n' tweaks)
Other Threads in the PHP Forum
- Previous Thread: php e-mail problem
- Next Thread: Checkbox array
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube






