LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-26-2013, 03:58 AM   #1
jamiebond
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Rep: Reputation: Disabled
.htaccess DOES hide the .php - but not if entered by user


Hi all,

When the user just clicks the links within the site, then the address bar will hide the .php. or html extension. As expected. So this works.

Also, when the user manually enters www.mydomain.com, then it resolves correctly to www.mydomain.com/index (without the php)

But when the user enters www.mydomain.com/index.PHP - then the php will stay in the address bar.

Is this normal ?

Here is my .htaccess:

Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
PS: Sorry to pop this unrelated question in here...
From the code above; how do I 'combine' the Condition and Rule in one line for both .php AND .html ?

Thank you kindly.
Jamie.
 
Old 08-26-2013, 04:04 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Is this normal ?
Yes, it is. Anything you enter in the address bar is considered "known" anyway...

Quote:
PS: Sorry to pop this unrelated question in here...
Umm, questions on this forum are rarely unrelated, and you posted in the right corner, so, that's cool

Welcome to the forum, hope you'll find the answers before you find frustrations of the search

Thor
 
Old 08-26-2013, 04:34 AM   #3
jamiebond
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
Ok thanks. Sorry, I should've gone for Search before posting my second question. It's Monday...
 
Old 08-27-2013, 02:40 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Ok thanks. Sorry, I should've gone for Search before posting my second question. It's Monday...
Dont worry, in fact, I put my questions here FIRST all the time, and THEN think about 'em ...so, go ahead, splash it in here
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
want to disable htaccess from updating the default php values set in php.ini nikeshp Linux - Software 2 05-26-2013 08:09 PM
User entered variable as counter in For Loop kross2100 Linux - Newbie 3 12-06-2012 01:03 PM
Where does the gtk.entry command save the text entered by the user? adhm9009 Linux - Newbie 4 07-27-2012 07:35 AM
[SOLVED] Small script to check if what the user entered is an ip or not robertjinx Linux - Server 6 11-30-2010 01:44 AM
Python socket question dealing with the ip address when its user entered xskycamefalling Programming 1 03-24-2010 01:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration