[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 03-04-2007, 09:34 AM   #1 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


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

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
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]

Last edited by Mutasim; 03-04-2007 at 09:44 AM.
H-O-V is offline  
Old 03-04-2007, 09:45 AM   #2 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


What you need to do is make a file called .htaccess, then use this code:
Code:
RewriteEngine on 
RewriteBase /
RewriteRule ^([.*]+).php$ whatever.php?content=$1 [L]
That should work
Barrucadu is offline  
Old 03-04-2007, 12:26 PM   #3 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


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 :P

(btw: i did change whatever to page.php)
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-04-2007, 12:32 PM   #4 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


Your server seems to be down, can you get on it?
Barrucadu is offline  
Old 03-04-2007, 01:17 PM   #5 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


hey please try now...
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-04-2007, 01:20 PM   #6 (permalink)
Barru.
 
Barrucadu's Avatar
 
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,731
78.50 NP$ (Donate)

Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold


try this:
Code:
RewriteEngine on 
RewriteBase /
RewriteRule ^([*]+).php$ whatever.php?content=$1 [L]
Btw, please dont PM me every time you reply, just because I posted in here dosn't mean I HAVE to keep helping you until its all working.
Barrucadu is offline  
Old 03-04-2007, 01:21 PM   #7 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


Quote:
Originally Posted by Mikor
Btw, please dont PM me every time you reply, just because I posted in here dosn't mean I HAVE to keep helping you until its all working.
sorry its just the urgency was getting to me (I will add rep when I'm sorted )

still doesn't work

just to clear things up...

i need

http://www.antibodypatterns.com/amphiphysin.php to mask for http://www.antibodypatterns.com/page...nt=amphiphysin using htaccess
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-04-2007, 01:49 PM   #8 (permalink)
NamePros Member
 
Join Date: Jan 2005
Posts: 112
0.00 NP$ (Donate)

lfhost is on a distinguished road


Before you try the below, you did change whatever.php in the code to page.php right?

or try

PHP Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule
^(.*).php$ page.php?content=$1 [L]
__________________
Thanks
Paul
1|2|3|4|5|6|7|8|9|10|11|12|13
lfhost is offline  
Old 03-04-2007, 01:50 PM   #9 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


lfhost your code is bring content as 'page'

but its closest so far :P

so it is including pagebody.php
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-04-2007, 01:59 PM   #10 (permalink)
NamePros Member
 
Join Date: Jan 2005
Posts: 112
0.00 NP$ (Donate)

lfhost is on a distinguished road


before you even try mod rewrite, try and fix your coding

http://www.antibodypatterns.com/page...nt=amphiphysin
shows
PHP Code:
Warning: main(pagebody.html) [function.main]: failed to open stream: No such file or directory in /home/abid/public_html/page.php on line 22

Warning
: main(pagebody.html) [function.main]: failed to open stream: No such file or directory in /home/abid/public_html/page.php on line 22

Warning
: main() [function.include]: Failed opening 'pagebody.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/abid/public_html/page.php on line 22
__________________
Thanks
Paul
1|2|3|4|5|6|7|8|9|10|11|12|13
lfhost is offline  
Old 03-04-2007, 11:06 PM   #11 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


that is something yo do with your htaccess...

when i remove it it all goes back to square 1
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-05-2007, 01:14 AM   #12 (permalink)
Senior Member
 
Peter's Avatar
 
Join Date: Nov 2003
Location: Scotland
Posts: 4,900
0.60 NP$ (Donate)

Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute

Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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.
Peter is offline  
Old 03-05-2007, 06:42 AM   #13 (permalink)
NamePros Regular
 
Join Date: Feb 2006
Posts: 588
1,620.95 NP$ (Donate)

jerometan is a name known to alljerometan is a name known to alljerometan is a name known to alljerometan is a name known to alljerometan is a name known to alljerometan is a name known to all


Warning : This is highly insecure code.

Please at least check to make sure the file requested is in the same directory!
jerometan is offline  
Old 03-06-2007, 03:17 AM   #14 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


the include is it the same directory
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Old 03-07-2007, 04:07 AM   #15 (permalink)
NamePros Regular
 
Join Date: Jun 2005
Location: UK
Posts: 515
83.95 NP$ (Donate)

H-O-V has a spectacular aura aboutH-O-V has a spectacular aura aboutH-O-V has a spectacular aura about


thanks anyway guys....

i got the answer off DigitalPoint
__________________
[ Facebook Applications | Buy, Sell & Discuss @ fbdn.org ]
H-O-V is offline  
Closed Thread


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
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:33 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85