djp1988 Posted October 31, 2008 Share Posted October 31, 2008 Hi, where can I post questions regarding .htaccess?Does this not merit it's own section on the forum? Link to comment Share on other sites More sharing options...
Jamesking56 Posted November 1, 2008 Share Posted November 1, 2008 Just post it here in General Link to comment Share on other sites More sharing options...
jeffman Posted November 1, 2008 Share Posted November 1, 2008 Does this not merit it's own section on the forum?The mods usually open a new section when there is demand. This happens when someone asks (and a bunch of people post their agreement) or when a whole bunch of topics on that subject start flying in. We have fielded .htaccess questions before, but really not a lot. Link to comment Share on other sites More sharing options...
djp1988 Posted November 1, 2008 Author Share Posted November 1, 2008 Okay, well i just wanted to understand a few things including jsut how url writing works, i tried rewriting the following url:domain.com/species.php?s=18 to domain.com/common-toad-bufo-bufo.htmlbut the browser tried to load domain.com/common-toad-bufo-bufo.html which didn't exist, is by rewriting url's I need to redirect them to an existing page? Link to comment Share on other sites More sharing options...
Synook Posted November 4, 2008 Share Posted November 4, 2008 Well, yes, what other sort of page could users go to, other than one that exists?The page that is being redirected away from doesn't have to exist, however. Link to comment Share on other sites More sharing options...
djp1988 Posted November 9, 2008 Author Share Posted November 9, 2008 So where is the advantage in rewritting an url, why not just send the user there in the first place ?I thought the url bar could just write for exemple .php to .html for show, but you're saying I need a html version of the page? Do I send the dynamic content to that page as static html? Link to comment Share on other sites More sharing options...
boen_robot Posted November 9, 2008 Share Posted November 9, 2008 I think there may be some misunderstanding here...You're usually rewriting domain.com/common-toad-bufo-bufo.html to domain.com/species.php?s=18, not the other way around. In other words, domain.com/common-toad-bufo-bufo.html is what the user sees, and domain.com/species.php?s=18 is the thing you want it to be equivalent of, right?The difference between a rewrite and a redirect is that a redirect will make the client make a new request, thus giving the user the "real" URL in their browser.A rewrite on the other hand simply makes one URL be equivalent of another, and thus the user doesn't see the "real" URL in their browser.You don't need to have a real document at the pseudo location which users see. However, the file you rewrite to must exist. That's why Synook rightfully told you that you need to have common-toad-bufo-bufo.html. If you want users to see "...php?..." stuff, and map it to the HTML file, the HTML file must exist. If you want users to see "...html" when the real file is "...php?...", then the HTML file doesn't need to exist, but the PHP file must. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.