Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-12-2011, 02:20 AM   PM User | #1
dnnhater
New Coder

 
Join Date: Jul 2011
Location: Sunshine State
Posts: 79
Thanks: 18
Thanked 0 Times in 0 Posts
dnnhater is an unknown quantity at this point
mod_rewrite with string variable

I don't even think I have the topic title right...it's almost no wonder I'm lost

the long and short is I need to have a single landing page that will be branded with each affiliate's banner...when I present this to them tomorrow, I want to be able to say "ok guys...all you need to do is send your agents to http://domain.com/affiliateshortname/carrier" so that they can download whatever documents they need

in so many tutorials this is demonstrated as something like:
RewriteRule ^[A-Za-z]/heartland/quick-quote.html$ /heartland/index.php?affiliateID=$1 [L]

and then I'll be able to get the appropriate header banner to display based on affiliateID

how can I get [A-Za-z] turned into $1 I think is what I'm asking

as always any help is greatly appreciated
dnnhater is offline   Reply With Quote
Old 10-12-2011, 03:18 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,738
Thanks: 4
Thanked 2,464 Times in 2,433 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This hasn't a thing to do with PHP, moving to apache configurations.
Wrap the [A-Za-z] in brackets. PHP will then be provided an affiliateID of that value found in the $_GET superglobal.
Fou-Lu is offline   Reply With Quote
Old 10-12-2011, 03:54 AM   PM User | #3
dnnhater
New Coder

 
Join Date: Jul 2011
Location: Sunshine State
Posts: 79
Thanks: 18
Thanked 0 Times in 0 Posts
dnnhater is an unknown quantity at this point
thanks for getting me in the right topic

ok so then I did have it kind of right...now I'm just getting 404 errors

the actual link that I will be providing my guys is http://mynsga.com/aam/heartland/quick-quote.html (aam is one of the affiliate short names) - I have tried to access it by typing that url in the address bar and by clicking on a link (<a href="/aam/heartland/quick-quote.html">blah</a>) and they both generate a 404 error

so this is what I have in my .htaccess:
Code:
ErrorDocument 400 /includes/config.php
ErrorDocument 401 /includes/config.php
ErrorDocument 403 /includes/config.php
ErrorDocument 404 /includes/config.php
ErrorDocument 500 /includes/config.php

RewriteEngine on
RewriteRule ^[A-Za-z]/heartland/quick-quote.html$ /heartland/index.php?affiliateID=$1 [L]
is it possible that mod_rewrite isn't available to me? could someone tell me what I need to look for in my phpinfo() to see if it's enabled? if it's not enabled then all of this is an exercise in futility as I don't have access to the httpd.conf file or whatever (although it's good stuff to learn anyway )

thanks in advance for your help

EDIT: just wanted to add that according to GoDaddy:
Quote:
Mod_rewrite is an Apache Web server module installed on all of our Linux servers by default; it does not have to be installed or enabled. Our Linux hosting accounts support most mod_rewrite functions.

Last edited by dnnhater; 10-12-2011 at 04:04 AM..
dnnhater is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:00 AM.


Advertisement
Log in to turn off these ads.