Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Sponsored Reviews   Improve your ranking, submit to directories   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2004, 09:15 AM   #1 (permalink)
Contributing Member
 
MrMean's Avatar
 
Join Date: 07-03-04
Location: Devon, England
Posts: 385
iTrader: 0 / 0%
MrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really nice
Send a message via MSN to MrMean Send a message via Yahoo to MrMean Send a message via Skype™ to MrMean
1 variable, mod rewrite help

Hi
This is probably simple I've been reading online browsing through forums etc to find the code I need, most of the examples which I've tested have worked properly....

I would like index.php?page=home to goto /home/ instead is that possible?

Would love some help If you can just enlighten me to the code that would be great, since this is really going to be the only time I use mod rewrite. :wink:
MrMean is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 07-07-2004, 09:22 AM   #2 (permalink)
Inactive
 
Pipeline-Webdesign's Avatar
 
Join Date: 02-11-04
Location: Corpus Christi, TX
Posts: 901
iTrader: 0 / 0%
Latest Blog:
None

Pipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the roughPipeline-Webdesign is a jewel in the rough
Send a message via AIM to Pipeline-Webdesign Send a message via MSN to Pipeline-Webdesign Send a message via Yahoo to Pipeline-Webdesign
Re: 1 variable, mod rewrite help

Quote:
Originally Posted by MrMean
Hi
This is probably simple I've been reading online browsing through forums etc to find the code I need, most of the examples which I've tested have worked properly....

I would like index.php?page=home to goto /home/ instead is that possible?

Would love some help If you can just enlighten me to the code that would be great, since this is really going to be the only time I use mod rewrite. :wink:
very possible...

at the very top place this code[code:1:53b00a89d0]<?php
$page = $_GET['page'];

if $page == ('home') { header('location:/home/index.php'); }
?>[/code:1:53b00a89d0]test it and tell me what happens
Pipeline-Webdesign is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 09:27 AM   #3 (permalink)
Contributing Member
 
MrMean's Avatar
 
Join Date: 07-03-04
Location: Devon, England
Posts: 385
iTrader: 0 / 0%
MrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really nice
Send a message via MSN to MrMean Send a message via Yahoo to MrMean Send a message via Skype™ to MrMean
I could have done that my self your missing the grand point...

I need it to be done with mod rewrite

so when you view /home/ it grabs the index.php?page=home contents

sorry i didn't explain it well enough orginally
MrMean is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 10:07 AM   #4 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,149
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
RewriteEngine On
RewriteRule ^/(.+)/$ http://www.domain.com/index.php?page=$1/ [L]

Not tested..
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 10:23 AM   #5 (permalink)
Contributing Member
 
MrMean's Avatar
 
Join Date: 07-03-04
Location: Devon, England
Posts: 385
iTrader: 0 / 0%
MrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really nice
Send a message via MSN to MrMean Send a message via Yahoo to MrMean Send a message via Skype™ to MrMean
Well it kind off works, its just displaying ?page=home ..... so its not picking the varible up
MrMean is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 12:06 PM   #6 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,149
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
Sorry.. thinking of rewriting a subfolder right now. Try this..
RewriteEngine On
RewriteRule ^(.+)/$ http://www.domain.com/index.php?page=$1
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-07-2004, 03:02 PM   #7 (permalink)
Contributing Member
 
MrMean's Avatar
 
Join Date: 07-03-04
Location: Devon, England
Posts: 385
iTrader: 0 / 0%
MrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really niceMrMean is just really nice
Send a message via MSN to MrMean Send a message via Yahoo to MrMean Send a message via Skype™ to MrMean
Thats perfect - works a treat, thank you your a saint!
MrMean is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to pass a php variable to asp code white10 Coding Forum 4 04-20-2007 05:11 AM
Searching for a specific phrase in a variable? Izzmo Coding Forum 9 11-27-2006 12:50 PM
Need a Simple Variable Script sixty6 Coding Forum 4 03-24-2006 09:03 AM
Trouble with using variable bytech Coding Forum 3 03-17-2005 11:57 PM
How to grab a variable from the URL Pipeline-Webdesign Coding Forum 3 08-31-2004 10:25 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:17 PM.
© Copyright 2008 V7 Inc