| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jun 2005 Location: UK
Posts: 518
![]() ![]() ![]() | Hide query strings? [.htaccess or what?] OK... my dad uses FrontPage to create html pages So previously to make a page there would be a php page called whatever.php and a html body called whateverbody.html and the php would simple 'include' the body as well as head.php and foot.php. This system worked but took time, so now I made dynamic urls so www.domain.com/page.php?content=whatever ^that would load whateverbody.php with the head and body ????: NamePros.com http://www.namepros.com/programming/301090-hide-query-strings-htaccess-or-what.html The problem is this is not very memorable and the php files have got a lot of backlinks so it there a way of masking/redirecting any php page that is typed like pageone.php (not actually a physical file) and get it to redirect / mask to www.domain.com/page.php?content=pageone there will need to be some exeptions and there are some static urls that exist and with this rule they would not be able to be reached ( i think)Thanks guys, Mutasim EDIT: a mate of mine suggests something called mod_rewrite :S
__________________ Lorem Ipsum
Last edited by Mutasim; 03-04-2007 at 10:44 AM.
|
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Jun 2005 Location: UK
Posts: 518
![]() ![]() ![]() | ok.... erm.. that doesn't seem to work :S http://www.antibodypatterns.com/page...nt=amphiphysin http://www.antibodypatterns.com/amphiphysin.php <-- doesn't work... help ![]() (btw: i did change whatever to page.php)
__________________ Lorem Ipsum |
| |
| | #6 (permalink) |
| Senior Member Join Date: Aug 2005 Location: East Yorkshire, England
Posts: 2,689
![]() ![]() ![]() ![]() ![]() ![]() ![]() | try this: Code: RewriteEngine on RewriteBase / RewriteRule ^([*]+).php$ whatever.php?content=$1 [L] |
| |
| | THREAD STARTER #7 (permalink) | ||||
| NamePros Regular Join Date: Jun 2005 Location: UK
Posts: 518
![]() ![]() ![]() |
) still doesn't workjust to clear things up... i need http://www.antibodypatterns.com/amphiphysin.php to mask for http://www.antibodypatterns.com/page...nt=amphiphysin using htaccess
__________________ Lorem Ipsum | ||||
| |
| | #10 (permalink) |
| NamePros Member Join Date: Jan 2005
Posts: 112
![]() | before you even try mod rewrite, try and fix your coding http://www.antibodypatterns.com/page...nt=amphiphysin shows PHP Code: |
| |
| | #12 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You should stop the errors from displaying. Also in your code have you stopped someone choosing what page they visit? ie do you sanitize the $content variable? If you do not using that method to choose the html output could cause 'other' output of my choosing to be displayed with a little trial and error, this includes things like config files, password files etc. |
| |