Menu
hi all,
i am trying to hide the “.php” extension in mywebsite. here i can do this only by changing “.php” to “.htm” or “.html”. as
[url]http://localhost/shopping/cart/checkout.php
to
[url]http://localhost/shopping/cart/checkout.htm
but i dont want to do like this instead, i want the following
[url]http://localhost/shopping/cart/checkout
can anybody please help me to do this using .htaccess
thanks in advance
Have you got an example I can look at?[/QUOTE]That is how the links in my signature don't have extensions. All that was needed was to remove the "#" in front of load module [I]mod_negotiation[/I] in my .httpd.conf file.
can anybody please give an example for this?[/QUOTE]
[CODE]
<files checkout>
ForceType application/x-httpd-php
</files>
[/CODE]
In your .htaccessThat's certainly better than using mod_rewrite.
[CODE]
[/QUOTE]
<files checkout>
ForceType application/x-httpd-php
</files>
[/CODE]
i included the code
<files checkout>
ForceType application/x-httpd-php
</files>
but even this gives mehttp://localhost/shopping/cart/checkout.php
help me please...[/QUOTE]
[CODE]<files cart.html>
ForceType application/x-httpd-php
</files>
[/CODE]
Can that take a pattern as the argument?[/QUOTE]
[code=php]www.mysite.com/store
www.mysite.com/store/checkout
www.mysite.com/fernando
www.mysite.com/users/jim/profile/edit[/code]
Just curious... why would one want to do this anyways?[/QUOTE]Because it is a W3C recommendation!
Smarty, is a MORE EFFICIENT way to write PHP[/QUOTE]The purpose of Smarty is to separate application code from presentation. Doing such a thing adds another layer between the PHP script and the output stage which certainly does NOT increase efficiency.
I think your looking for<FilesMatch> ?[/QUOTE]
The purpose of Smarty is to separate application code from presentation. Doing such a thing adds another layer between the PHP script and the output stage which certainly does NOT increase efficiency.[/QUOTE]
I just built a website, that is extremely powerful, and simply skinable. Take a look at a myspace page that is for a brand or advertisement, same myspace functionality, with a completely different look and feel. They sell these pages for hundreds of thousands of dollars... and all it takes is a junior programmer, who has never seen php, to change the template files, he would never see the application files and code.[/QUOTE]I don't see how your posts are related to what the OP has asked.
If creating and seperating a logic layer and a presentation layer is not more efficient , then I will be the next president of the United States... but I guess some old school programmers would disagree.[/QUOTE]Looks like you haven't read the documentation on Smarty's website.
i got it worked.. if i want all files to work in this way then shall i do like this
<files cart, checkout,index>
ForceType application/x-httpd-php
</files>
thanks for all of yur responses.[/QUOTE]
[CODE]<FilesMatch "^[^.]+$">
ForceType application/x-httpd-php
</FilesMatch>[/CODE]
[code=php]
//What page are we looking for?
$myURL = $_SERVER['REQUEST_URI'];
$cleanURL = explode("?", $myURL);
$requestURL = $cleanURL[0];
$redirectURL = $myURL;
$_pageData = new _pageData();
$_pageData->_pageURL = $myURL;
//Look for group
$myURLPieces = split("/", strtolower($requestURL));
//Look for homepage
if(!$myURLPieces[1] || $myURLPieces[1] == 'index.php' ) {
$pageGroup = 'homePage';
}else{
$pageGroup = $myURLPieces[1];
$_pageData->_pageGroup = $pageGroup;
}
//is there a subgroup?
if($myURLPieces[2] != ""){
$subGroup = $myURLPieces[2];
$_pageData->_subGroup = $subGroup;
}
//is there a mode?
if($myURLPieces[3] != ""){
$pageMode = $myURLPieces[3];
$_pageData->_pageMode = $pageMode;
}
//is there a command?
if($myURLPieces[4] != ""){
$command = $myURLPieces[4];
$_pageData->_command = $command;
}
//is there a subCommand?
if($myURLPieces[5] != ""){
$subCommand = $myURLPieces[5];
$_pageData->_subCommand = $subCommand;
}
// Page Object Dispatcher
switch($pageGroup) {
case "homePage":
$myPage = new homePage;
break;
case "register":
$myPage = new registerPage;
break;
case "login":
$myPage = new Page;
break;
case "signout":
$myPage = new Page;
break;
case "forgotpassword":
$myPage = new forgotPasswordPage;
break;
case "browse":
case "search":
$myPage = new searchPage;
break;
// MEMBERS //
case "member":
case "users":
switch($pageMode) {
case "validate":
$myPage = new userValidate;
break;
case "settings":
$myPage = new userAccountSettings;
break;
case "resetpassword":
$myPage = new userResetPassword;
break;
case "gallery":
$myPage = new userGallery;
break;
case "blog":
$myPage = new userBlog;
break;
// SOCIAL NETWORKING
case "profile":
$myPage = new userProfileSettings;
break;
case "comments":
$myPage = new userComments;
break;
case "messages":
$myPage = new userMessages;
break;
case "add":
case "friends":
case "invite":
case "block":
$myPage = new userNetworking;
break;
// We either don't have a pageMode, or one
// we don't know what to do with yet, most likely a users home/profile.
default:
// We're looking for a userpage,
// so the subGroup should be the username
$myPage = new userPage;
$myPage->setSubGroup($subGroup);
$myPage->_pageMode = $pageMode;
break;
}
break;
// STORE
case "store":
switch($subGroup) {
case "item":
$myPage = new storeProduct;
break;
case "catalog":
$myPage = new storeCatalog;
break;
case "cart":
$myPage = new storeCart;
break;
case "checkout":
$myPage = new storeCheckOut;
break;
case "orders":
$myPage = new storeOrders;
break;
default:
$myPage = new storePage;
break;
}
break;
case "contact":
$myPage = new contactPage;
break;
case "about":
$myPage = new aboutPage;
break;
// ADMIN SECTION //
case "admin":
switch($subGroup){
// ADMIN STORE
case "store":
switch($pageMode){
case "items":
$myPage = new adminStoreItems;
break;
case "invoices":
$myPage = new adminStoreInvoices;
break;
case "categories":
$myPage = new adminStoreCategories;
break;
default:
$myPage = new adminPage;
break;
}
break;
// CONTENT
case "content":
$myPage = new adminContent;
break;
case "maintenance":
$myPage = new adminMaintenance;
break;
case "users":
$myPage = new adminUsers;
break;
default:
$myPage = new adminPage;
break;
}
break;
default:
//Unknown page!
$myPage = new Page;
//Error will kill page progress
$myError = new error;
$msg = "Page does not exist";
$myError->create($msg, $GLOBALS['requestURL'], '404', '');
break;
}
[/code]
If you've ever worked for a major website company [...] it doesn't take a genious to understand why this is important and efficient for a large company.[/QUOTE]So basically what you are saying Smarty is great for companies that want to have a low-paid, unskilled workforce.
Do you know what the difference between an integrator and a programmer is? Did you know they are two completely different positions at a large scale web development company? Apparently not, could someone please explain it to him.Argumentum ad hominem consists of replying to an argument by attacking or appealing to the person making the argument, rather than by addressing the substance of the argument. It is most commonly used to refer specifically to the ad hominem abusive, or argumentum ad personam, which consists of criticizing or personally attacking an argument's proponent in an attempt to discredit that argument.
Oh, perhaps i confused you? I guess it might take a genious to understand... im sorry for confusing you.[/QUOTE]
Those are just titles given to employees to keep them busy looking down upon and sucking up to one another in a bid to distract them from the enslavement in which they are trapped. Fortunately, I am not a componant of that heirarchy of subordinates.[/QUOTE]
Those are just titles given to employees to keep them busy looking down upon and sucking up to one another in a bid to distract them from the enslavement in which they are trapped. Fortunately, I am not a componant of that heirarchy of subordinates.[/QUOTE]
performing or functioning in the best possible manner with the least waste of time and effort; having and using requisite knowledge, skill, and industry; competent; capable: a reliable, efficient secretary.
[/quote]
Bokeh, thinking everyone is a genius is false...[/quote]Did you mean Bokeh? Or were you referring to:
Oh, perhaps i confused you? I guess it might take a genious to understand... im sorry for confusing you.[/quote]I'm losing track of the geniuses...
0.1.9 — BETA 6.17