Hello,
What I'd like is to be able to send a person to a unique page via a customized link including it's name and displaying it on the page.
So, to be clear, I have a page at this URL:
mysite.com/video/
I send an email to the person, let's say his name is Joe so I just add Joe to the URL:
mysite.com/video/joe
He is then sent to the page and can see somewhere on the page his name, like "Hello Joe, watch the video I did for you...".
If his name is Jane then the URL would be:
mysite.com/video/jane
I just want to have one page and that whatever I add to the URL it would drive the person to the URL mysite.com/video/
This is to avoid to have to create an identical page X times, one for Joe, one for Jane, one for David...
It certainly is easy but as I'm just a beginner in PHP, it's not so obvious for me.
Thanks a lot for your help.
David
How to create a customized URL/page
Moderator: General Moderators
Re: How to create a customized URL/page
You basically want a rewrite rule in your .htaccess file (assuming you're using Apache). This should do the trick:
Code: Select all
RewriteEngine On
RewriteRule ^video/(.*)/? video/?q=$1 [NC,L]Re: How to create a customized URL/page
Thanks for this code. But I never used any command to change the .htaccess file except for scripts I purchased and then just copy/paste some piece of code in the file.Celauran wrote:You basically want a rewrite rule in your .htaccess file (assuming you're using Apache). This should do the trick:
Code: Select all
RewriteEngine On RewriteRule ^video/(.*)/? video/?q=$1 [NC,L]
q=$1 is a variable I could use in my script on the .php page? It would contain the text entered in the URL after the mysite.com/video/?
Thank you very much for your help.
Re: How to create a customized URL/page
It was just an example. q can be anything you want. If would be available to the script through $_GET['q'] (or whatever you call q)
-
Jaz Madrid
- Forum Newbie
- Posts: 1
- Joined: Mon Sep 15, 2014 5:44 am
Re: How to create a customized URL/page
Thanks, I had the same quiestion
Re: How to create a customized URL/page
Thank you very much Celauran.