URL Links/Rewrites?

This is a discussion on "URL Links/Rewrites?" within the PHP Forum section. This forum, and the thread "URL Links/Rewrites? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 3rd, 2008, 13:43
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
URL Links/Rewrites?

Did not know where the best place to put this was so I'll put it here, but please move if needed.

Right now the URLS of Penguin are: single.php?contentid=1 or category.php?category=category or month.php?month=1
When you first use WordPress, it is like that, but you can change it by adding something to the .htaccess file and, I'm presuming that some PHP is involved. Can anyone help me with what to do? I appreciate it is a big task, any help is welcome.

Thanks,

Jack
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote

  #2 (permalink)  
Old Feb 3rd, 2008, 14:06
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: URL Links/Rewrites?

Okay I was going to write a sticky first but I'll give you some tips.
Here's one for the month:

RewriteRule ^month/([0-9]+)-[a-zA-Z]$ month.php?id=$1 [L]

Which could be accessed via www.example.com/month/2-february
The 2 in the url would be passed to month.php making it month.php?id=2.
Let me know how you get on.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Feb 3rd, 2008, 14:09
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

I just put the .htaccess in the root folder right?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #4 (permalink)  
Old Feb 3rd, 2008, 14:13
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

Alex, I upload the .htaccess and navigate to http://www.jackfranklin.co.uk/month/2-february and no luck. The htaccess is:
Code: Select all
RewriteRule ^month/([0-9]+)-[a-zA-Z]$ month.php?id=$1 [L]
Ignore the 404 by the way, I did that about 2 years ago lol.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 3rd, 2008, 14:22
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: URL Links/Rewrites?

You'll need to create the clean URL in the PHP that looks like http://www.jackfranklin.co.uk/month/2-february
Reply With Quote
  #6 (permalink)  
Old Feb 3rd, 2008, 14:23
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

Sorry? I dont understand Mark. Could you give me an example?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #7 (permalink)  
Old Feb 3rd, 2008, 14:25
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: URL Links/Rewrites?

PHP: Select all

$notAllowed = array("!"","".""[""]"">""<"";""&""^""%""$""£""@"'"'"#""~""*("")""\"");
    
$cleanerTitle str_replace($notAllowed""$row['title']);
    
$cleanTitle str_replace(" ""-"strtolower($cleanerTitle)); 
That is me creating my CLEAN URL.
Reply With Quote
  #8 (permalink)  
Old Feb 3rd, 2008, 14:27
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

I'm sorry but I still have no idea what I need to do to make the re-write work.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #9 (permalink)  
Old Feb 3rd, 2008, 14:31
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: URL Links/Rewrites?

Is that all your htaccess contains? You need to turn on the rewrite engine with this at the top of your htacces:
Code: Select all
RewriteEngine on
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #10 (permalink)  
Old Feb 3rd, 2008, 14:32
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: URL Links/Rewrites?

Quote:
Originally Posted by Marc View Post
PHP: Select all

$notAllowed = array("!"","".""[""]"">""<"";""&""^""%""$""£""@"'"'"#""~""*("")""\"");
    
$cleanerTitle str_replace($notAllowed""$row['title']);
    
$cleanTitle str_replace(" ""-"strtolower($cleanerTitle)); 
That is me creating my CLEAN URL.
Marc, he needs to get the rewrite to actually work before he can create the links dynamically.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #11 (permalink)  
Old Feb 3rd, 2008, 14:33
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

I've added that, but the same problem still.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #12 (permalink)  
Old Feb 3rd, 2008, 15:03
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

So, it's not working at all. I've checked the .htaccess file. Would it be something with my hosts?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #13 (permalink)  
Old Feb 3rd, 2008, 15:20
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,770
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: URL Links/Rewrites?

You got this in there also?
Code: Select all
Options +FollowSymLinks

Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #14 (permalink)  
Old Feb 3rd, 2008, 16:19
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: URL Links/Rewrites?

Have now. Still nothing happening though.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #15 (permalink)  
Old Feb 3rd, 2008, 16:55
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,650
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: URL Links/Rewrites?

Quote:
Originally Posted by alexgeek View Post
Marc, he needs to get the rewrite to actually work before he can create the links dynamically.
I was just saying in General..
Reply With Quote
  #16 (permalink)  
Old Feb 3rd, 2008, 20:28
simonb's Avatar
Blog Moderator

Join Date: Dec 2006
Location: Norwich
Posts: 677
Blog Entries: 4
Thanks: 4
Thanked 2 Times in 2 Posts
Send a message via Skype™ to simonb
Re: URL Links/Rewrites?

Its not working because jack has no http://www.jackfranklin.co.uk/month.php on his server
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Msie doesn't make my links links.. delusion Web Page Design 7 Nov 7th, 2007 08:05
PR4 links for sale...links in an excellent position agent14 Link Building and Link Sales 1 Mar 5th, 2007 21:33
Blured Links (image links) bruno89 Web Page Design 2 Jul 25th, 2006 14:48
Come on then, Mod-rewrites and 301's JamieH Other Programming Languages 6 Dec 23rd, 2005 14:47
Different coloured links without modifying links? Webforumz Staff Web Page Design 12 Aug 29th, 2003 18:48


All times are GMT. The time now is 05:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43