Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 May 2016, 14:31
I.G.O.T.A.'s Avatar
I.G.O.T.A. I.G.O.T.A. is offline
 
Join Date: Mar 2011
Real name: JJ Smith
Hiding .php with .htaccess file

Is it possible to hide the .php extension in the .htacess file? If so what is the best way to do you?

Thank you,
JJ
Reply With Quote
  #2  
Old 02 May 2016, 19:59
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
What do you mean by "hide it" ?
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #3  
Old 02 May 2016, 20:02
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
http://stackoverflow.com/a/8371815/6275228

I don't see why you would want to do that though. If you currently have SEO .htaccess rules in place, it may mess up.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #4  
Old 03 May 2016, 10:34
I.G.O.T.A.'s Avatar
I.G.O.T.A. I.G.O.T.A. is offline
 
Join Date: Mar 2011
Real name: JJ Smith
Originally Posted by Paul M View Post
What do you mean by "hide it" ?
it would be just forum instead of forum.php

Originally Posted by Dave View Post
http://stackoverflow.com/a/8371815/6275228

I don't see why you would want to do that though. If you currently have SEO .htaccess rules in place, it may mess up.
I got that all taken care of, but I can't seem to get nothing to work to hide the extension. I can do it on Xenoforo, but not with vB.
Reply With Quote
  #5  
Old 03 May 2016, 11:12
In Omnibus's Avatar
In Omnibus In Omnibus is online now
 
Join Date: Apr 2010
Real name: Kris
The extension is a function of the browser, not of the software.
Reply With Quote
  #6  
Old 03 May 2016, 22:49
I.G.O.T.A.'s Avatar
I.G.O.T.A. I.G.O.T.A. is offline
 
Join Date: Mar 2011
Real name: JJ Smith
Originally Posted by ProSportsForums View Post
The extension is a function of the browser, not of the software.
So there is no way to do this?
Reply With Quote
  #7  
Old 03 May 2016, 22:54
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
It is possible, you just have to find the right .htaccess rules to rewrite any requests not containing .php in the URL to its version with .php in it. On top of that you should check if the file exits using another .htaccess rule.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #8  
Old 04 May 2016, 06:52
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
This is what I have been using in the past with non vB-sites:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Anyway - all of this will not remove the file extensions in vB, i.e. the links in the software will still be .php.

Having this used before: it works, but I would advise against using it. I wouldn't go through the potential trouble just for cosmetic reasons.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #9  
Old 04 May 2016, 12:35
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
The question is why do you want to do it ?

There is the option to use "Mod Rewrite Friendly URLs" in vB4, which (obviously) has to be combined with some htaccess rules (supplied) which will basically do what you want (use urls with no .php extension).
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #10  
Old 04 May 2016, 13:55
I.G.O.T.A.'s Avatar
I.G.O.T.A. I.G.O.T.A. is offline
 
Join Date: Mar 2011
Real name: JJ Smith
Originally Posted by Paul M View Post
The question is why do you want to do it ?

There is the option to use "Mod Rewrite Friendly URLs" in vB4, which (obviously) has to be combined with some htaccess rules (supplied) which will basically do what you want (use urls with no .php extension).
We have that working, but the main forum still shows the .php. We've tried to hide with the code we have below and it works for what you see below, but not for the main forum.

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]
Reply With Quote
Reply


Tags
htaccess, php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:18.

Layout Options | Width: Wide Color: