I am going to have 5 different pages and the URL is going to look like this:
Now how can I transform this into:
How can I do this? What would the code for my .htaccess file look like?
The htaccess code would look like this:
RewriteRule ^tdn/(.*)$ tdn.php?page=$1 [L,NC]
Read this article and then try to write some code. If you have problems post it here and we'll try to help you.
YOU have to write the blahblah code in your links - mod_rewrite can redirect to the actual script.
lix0r was on the right track but I :kaioken: LOATHE :kaioken: the indiscrimate use of the EVERYTHING atom like that. If you know that "blahblah" is going to be one or more lowercase letters, then use ([a-z]+). His solution will give you tdn.php?page= and you'd better be able to handle that in your script!
My signature's article also has an article which has helped members - it was designed to prevent my retyping the same answers over and over to common questions and should answer yours, too.
hehe! I didn't mean to offend you dklynn :p I just copied the lines straigh out of my .htaccess file. And I do let the script handle what's in the everything atom. This is because I both pass id-number and plain tex through there :P
You article was pretty good though, and I'll try to avoid using (*.) in the future ;)
No offense taken - just my normal rant about the everything atom 'cause it can (and DOES) cause so many problem for those who are not aware. I don't like to tell newbies to use that UNLESS they MEAN to capture EVERYTHING and redirect it in such a way as NOT to loop.
Glad that you liked the article - as I'd said, it was meant to prevent repetitive typing.
Your article is very interesting, dklynn, but I am still failing to learn how to actually write the coding.
I have decided to use a different structure in the URL...
How can I do this?
EDIT: I think I've found the right coding:
RewriteRule ^viewcontent/(.*)/(.*) /viewcontent.php?type=$1&page=$2
[rant][repeatedly]WHY would you use the :kaioken: EVERYTHING :kaioken: atom when you know that you will only use lowercase letters?[/repeatedly][/rant]