.htaccess help

  • ccb056
  • Graduate
  • Graduate
  • User avatar
  • Joined: Mar 20, 2004
  • Posts: 189
  • Status: Offline

Post April 17th, 2004, 7:59 am

Hi, I'm looking for a few lines in an .htaccess file to help me do the following and include a 301 redirect

rewrite
"http://www.computerbb.org/ftopic(numvar).php"
to
"http://www.computerbb.org/about(numvar).html"

rewrite
"http://www.computerbb.org/sutra(numvar).php"
to
"http://www.computerbb.org/post-(numvar).html"

rewrite
"http://www.computerbb.org/forum(numvar).php"
to
"http://www.computerbb.org/forum-(numvar).html"

thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 17th, 2004, 7:59 am

  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post April 17th, 2004, 9:10 am

http://www.ozzu.com/programming-forum/quick-tip-mod-rewrite-t23460.html <-- That post I made should help, but incase it doesn't you can do something like this:

Ohh wait I see what you're doing :-P (I think). Look in the .htaccess file for something like this:

Code: [ Select ]
RewriteRule ^ftopic([0-9]+).php$ ftopic.php?var=$1 [L,NC]
//and change it to
RewriteRule ^about([0-9]+).html$ ftopic.php?var=$1 [L,NC]
  1. RewriteRule ^ftopic([0-9]+).php$ ftopic.php?var=$1 [L,NC]
  2. //and change it to
  3. RewriteRule ^about([0-9]+).html$ ftopic.php?var=$1 [L,NC]


You only need to change the first part, from the ^ to the $ to change what you type for the url to get the second part (ftopic...$1). The patern remains the same for each one.

I'm not sure how the mod does it but they might also have (.*) instead of ([0-9]+)
Pixel Acres V2
  • ccb056
  • Graduate
  • Graduate
  • User avatar
  • Joined: Mar 20, 2004
  • Posts: 189
  • Status: Offline

Post April 17th, 2004, 9:17 am

what does the L and NC do?

edit, the code you supplied doesnt work
  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Joined: Mar 20, 2004
  • Posts: 401
  • Loc: Scorpion Hole
  • Status: Offline

Post April 17th, 2004, 10:48 am

Ok, well the 'L' stands for 'last', which would stop the rewriting process.
The 'NC' stands for 'no case', which would make a-z and A-Z be exactly the same.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 219 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.