This is a discussion on "writing htaccess" within the PHP Forum section. This forum, and the thread "writing htaccess are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
writing htaccess
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
writing htaccess
how would I implement htaccess into my blog creation. example how can i get the following: http://www.alexgeek.co.uk/blog.php?id=2 to rewrite to: http://www.alexgeek.co.uk/blog/googlers automatically when the entry is made? Googlers is the title of that entry. Hope thats clear
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|
|
#2
|
|||
|
|||
|
Re: writing htaccess
Well, the rewrite rule would look something like this:
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#3
|
||||
|
||||
|
Re: writing htaccess
Thanks, I'll see what I can come up with.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#4
|
||||
|
||||
|
Re: writing htaccess
I thought of an easier (slightly less SEO friendly) way of doing this.
for each blog, i will write a new php file. so the googlers entry would be something like: alexgeek.co.uk/blogs/googlers.php the file would be: <?php include('../blog.php?id=2); ?> A lot easier i think. and SEO won't be that bad I don't think.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#5
|
|||
|
|||
|
Re: writing htaccess
OUCH! That's ok for a smaller, relatively static web site, but NOT for a blog. Think about how the folder where you store your *.php blog entries is going to look when you have 100 blog entries....
What you're planning on doing is like manually re-inventing mod_rewrite.....! All you need is a unique name or id for each blog entry and reading the entries out of a database will work. You don't need to make a new file for each entry AND store the entries in a DB!
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#6
|
||||
|
||||
|
Re: writing htaccess
htaccess is very confusing.
I think it may be too advanced for me.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#7
|
|||
|
|||
|
Re: writing htaccess
Quote:
You don't have to conquer all of Rome this evening, start by building yourself a little "regex dagger." I promise you'll get your big guns later!
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#8
|
||||
|
||||
|
Re: writing htaccess
Thanks ha
They confuse me, but I'll try harder! cheers Jan.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#9
|
|||
|
|||
|
Re: writing htaccess
That's the way I like it!
PS: the Backstreet Boys suck!
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#10
|
|||
|
|||
|
Re: writing htaccess
htaccess isn't oo bad when you get what is going on but it is daunting at first
|
|
#11
|
||||
|
||||
|
Re: writing htaccess
It seems to me that these two contradict each other:
Quote:
Quote:
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#12
|
|||
|
|||
|
Re: writing htaccess
Nope, the ^caret just has different meaning in different places.
When it comes at the very beginning of a regex, then it means that the string HAS to start here. When it comes right after a [ square bracket (character class definition) then it means "match everything but the characters defined here." And a \b word boundary is "a position BETWEEN a character that can be matched by \w and a[nother] character that cannot be matched by \w." We're talking about two different characters here, just in case that was also confusing you.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#13
|
||||
|
||||
|
Re: writing htaccess
Thanks, that part really confused me!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| htaccess | BarryM | Web Page Design | 3 | Oct 27th, 2006 19:28 |
| .htaccess | benbacardi | PHP Forum | 6 | Nov 15th, 2005 16:23 |