Private Label and Cobranded VoIP Solutions
BrainCast internet & phone based message/memo recording & reminder organization system
Internet Phone Service and Broadband Phone Service by ViaTalk

Go Back   VoIP Forums, Internet Phone Service Forums, & Web Hosting Forums > CoderForums - Programming Discussion > General Programming Issues > Programming Languages & Technologies > PHP

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-02-2002, 02:36 PM
Brute Brute is offline
Registered User
 
Join Date: Jul 2001
Posts: 10
help with mod_rewrite

Anyone here using mod_rewrite, php and .htaccess to create search engine friendly urls?

something like: http://www.bla.com/articles/25 instead of http://www.bla.com/articles.php?id=25

I can't get it to work. Anyone who can help me out?

Thanks

- - -
Brute D.
Reply With Quote
  #2  
Old 03-02-2002, 03:13 PM
Stewart's Avatar
Stewart Stewart is offline
That's me!
 
Join Date: Jun 2001
Location: UK
Posts: 376
hi!

just what im implementing in my new site now, it requires htaccess and a bit of php:

http://www.promotionbase.com/article/485
__________________
Stewart Whiting

Need computer or network help? Come to http://www.coreworldstech.com
Reply With Quote
  #3  
Old 03-02-2002, 08:02 PM
fatal fatal is offline
SeXy Customer
 
Join Date: Feb 2002
Posts: 23
how exactly do you do it? some code or a site with a tutorial would be nice

[EDIT]
haha, im an idiot, didnt realize that link was for that :O

Last edited by fatal; 03-02-2002 at 08:05 PM.
Reply With Quote
  #4  
Old 03-02-2002, 09:43 PM
El_Nino El_Nino is offline
Tropical Storm
 
Join Date: Feb 2001
Posts: 484
Try looking at this article: Building dynamic pages with search engines in mind

Edit: Sorry, that's the wrong link, I thought it was for something else, if I can find the link I was thinking of, I'll post it.

Last edited by El_Nino; 03-02-2002 at 10:01 PM.
Reply With Quote
  #5  
Old 03-03-2002, 06:12 AM
Brute Brute is offline
Registered User
 
Join Date: Jul 2001
Posts: 10
Quote:
Originally posted by Stewart
hi!

just what im implementing in my new site now, it requires htaccess and a bit of php:

http://www.promotionbase.com/article/485
Which one of these methods do you use?

I also found another tutorial and other method at:

http://www.alistapart.com/stories/succeed/

Have been trying it, but it gives me Parse Errors
Reply With Quote
  #6  
Old 03-03-2002, 07:17 AM
Stewart's Avatar
Stewart Stewart is offline
That's me!
 
Join Date: Jun 2001
Location: UK
Posts: 376
i think the sitepoint tutorials look a lot easier to follow, I would recommend the third way on sitepoint. it has the least downpoints and is fully search engine compatible
__________________
Stewart Whiting

Need computer or network help? Come to http://www.coreworldstech.com
Reply With Quote
  #7  
Old 03-03-2002, 10:36 AM
Brute Brute is offline
Registered User
 
Join Date: Jul 2001
Posts: 10
ok, thanks

will give it a try

- - -
Brute
Reply With Quote
  #8  
Old 03-06-2002, 04:08 PM
riffola riffola is offline
Registered User
 
Join Date: Feb 2001
Posts: 17
Try this
Code:
RewriteEngine On
RedirectMatch 301 ^/article$ /article/
RewriteRule ^article/$ /article.php [L]
RewriteRule ^article/(.*)/$ /article.php?id=$1 [L]
Reply With Quote
  #9  
Old 03-07-2002, 04:54 PM
nyoung nyoung is offline
Registered User
 
Join Date: Dec 2000
Location: Northern Virginia (Fairfax)
Posts: 14
if you don't necessarily want to use .htaccess or mod_rewrite, you can place this code block at the top of your page:

$url_array = explode("/",$PATH_INFO);
if (count($url_array) > 1) {
for($i=1;$i<count($url_array);$i++) {
$data[$url_array[$i]] = $url_array[++$i];
}
extract($data);
}

Format url parameters like /variable1/value1/variable2/value2/

example:

http://www.domain.com/id/30/color/red/number/2/

To retrieve the values:
<?
echo $id //returns 30
echo $color //returns red
echo $number //returns 2
?>
Reply With Quote
  #10  
Old 03-07-2002, 05:06 PM
Stewart's Avatar
Stewart Stewart is offline
That's me!
 
Join Date: Jun 2001
Location: UK
Posts: 376
thats what is on sitepoint, u still need to modify htaccess though
__________________
Stewart Whiting

Need computer or network help? Come to http://www.coreworldstech.com
Reply With Quote
  #11  
Old 03-07-2002, 05:51 PM
nyoung nyoung is offline
Registered User
 
Join Date: Dec 2000
Location: Northern Virginia (Fairfax)
Posts: 14
Indifferent

I currently use it with no modification to .htaccess what so ever :-)
Reply With Quote
Reply

Thread Tools
Display Modes 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