05-07-2006, 11:58 AM
· #1 New Member
Shorter URLs
In your .htaccess file add:
Code:
<Files page>
SetHandler application/x-httpd-php
</Files>
Now file "page" will be a php page without the file extension ".php"
www..com/page www..com/page.php
05-07-2006, 12:31 PM
· #2 Buy my domains.
Name: Dan
Join Date: Feb 2006
Posts: 2,800
NP$: 54.00 (
Donate )
I don't see why you would want to do that..
That would mess up folders, too. If you linked to a folder on your site without the trailing slash it would go to the foldername.php
05-07-2006, 06:25 PM
· #3 New Member
Originally Posted by Dan Friedman I don't see why you would want to do that..
That would mess up folders, too. If you linked to a folder on your site without the trailing slash it would go to the foldername.php
Not true, it would only go to "page" no matter what. I think you are confused. You are renaming the file to just “page” page.php does not exist anymore.
http://www.firstmortgageguide.com/articles http://www.firstmortgageguide.com/forum
05-07-2006, 07:18 PM
· #4 Buy my domains.
Name: Dan
Join Date: Feb 2006
Posts: 2,800
NP$: 54.00 (
Donate )
Yes, so since you don't need an extension to make it PHP, if you went to site.com/folder it would go to folder.php and not the actual folder.
Say you linked to your forums (site.com/forums) that would do forums.php which isn't what you want.
You would have to make all links go to site.com/forums/
Plus, it only gets rid of .php.. not that big of a difference.
05-07-2006, 07:35 PM
· #5 New Member
Originally Posted by Dan Friedman Yes, so since you don't need an extension to make it PHP, if you went to site.com/folder it would go to folder.php and not the actual folder.
Understand your logic. This is just another way to make shorter URLs.
Then you can pass vars
www..com/page/var/ PHP Code:
$var_array = explode ( "/" , $PATH_INFO );
$your_var = $var_array [ 1 ];
Example, you can have this:
www..com/page.php?var=BLAH (Ugly!)
or you can have this:
www..com/page/BLAH/ (Clean and SEO friendly!)
05-28-2006, 09:22 PM
· #6 NamePros Member
Name: Steve
Location: NY
Join Date: Apr 2006
I like the script... but is there any advanced version of it,..... i mean is there any class available that more sufficiently manages it?
__________________
- Steve
06-03-2006, 12:43 PM
· #7 Soon to be RICHdoggie!
Name: Tom
Location: UK
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (
Donate )
Originally Posted by jpm6917 Code:
<Files page>
SetHandler application/x-httpd-php
</Files>
That wouldn't change EVERY file? Just page.php?
If I put "<Files search>" it would just be search.php? and not EVERY SINGLE FOLDER?
Am I right?
Thanks
Tom
06-06-2006, 05:11 PM
· #8 NamePros Regular
Location: London, UK
Join Date: May 2006
What about using the mod_rewrite method:
PHP Code:
Add this to the . htaccess file on the root of your server :
RewriteEngine on
RewriteBase /
RewriteCond %{ REQUEST_FILENAME }. php - f
RewriteCond %{ REQUEST_URI } !/$
RewriteRule (.*) $ 1 . php [ L ]
RewriteCond %{ REQUEST_FILENAME } !- d
RewriteRule ^(.+)/$ /$ 1 [ R = 301 , L ]
That should just strip out the php extension of evry file.
- Vince
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off