Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 3rd, 2003, 08:08 PM
mike6219 mike6219 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Austin, Texas
Posts: 21 mike6219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 sec
Reputation Power: 0
Send a message via AIM to mike6219 Send a message via Yahoo to mike6219
mod_rewrite problem

Hello all again,

I'm trying to setup mod_rewrite on my test server and I'm having some major problems.

First, here's my .htaccess file:
Quote:
RewriteEngine On
RewriteBase /
RewriteRule /story/([0-9]+)/([0-9]+).php story.php?story=$1&page=$2
DirectoryIndex index.php index.html index.htm


(The RewriteRule is all on one line)

I'm trying to convert story.php?story=1&page=1 into story/1/1.php

I also have the rewrite log file if you need to see it.

Thanks for your help, again.

Mike

Reply With Quote
  #2  
Old December 4th, 2003, 01:49 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: mod_rewrite problem

Try:

Code:
RewriteRule ^/story/([0-9]+)/([0-9]+).php$ /story.php?story=$1&page=$2


Reply With Quote
  #3  
Old December 4th, 2003, 01:53 AM
mike6219 mike6219 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Austin, Texas
Posts: 21 mike6219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 sec
Reputation Power: 0
Send a message via AIM to mike6219 Send a message via Yahoo to mike6219
RE: mod_rewrite problem

Still nothing, I get a 404 error. I am able to type out the entire URL and it work fine. Hmmmm, any other ideas?

Mike

Reply With Quote
  #4  
Old December 4th, 2003, 02:00 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: mod_rewrite problem

Try putting these two lines in your .htaccess file:

Code:
RewriteCond %{HTTP_HOST} !^codewalkers.com
RewriteRule ^.*$ http://codewalkers.com%{REQUEST_URI} [R=301,L]


That should send every request to codewalkers.com. If that doesn't work, then we know that the rewrite engine 1) isn't working, or 2) isn't reading from that .htaccess file.

Reply With Quote
  #5  
Old December 4th, 2003, 02:04 AM
mike6219 mike6219 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Austin, Texas
Posts: 21 mike6219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 sec
Reputation Power: 0
Send a message via AIM to mike6219 Send a message via Yahoo to mike6219
RE: mod_rewrite problem

It immedietly redirected to codewalkers.com.

Reply With Quote
  #6  
Old December 4th, 2003, 02:07 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: mod_rewrite problem

Looked at it again...sorry I had an extra slash in the front. It should be:

Code:
RewriteRule ^story/([0-9]+)/([0-9]+).php$ /story.php?story=$1&page=$2


Reply With Quote
  #7  
Old December 4th, 2003, 02:11 AM
mike6219 mike6219 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Austin, Texas
Posts: 21 mike6219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 sec
Reputation Power: 0
Send a message via AIM to mike6219 Send a message via Yahoo to mike6219
RE: mod_rewrite problem

Yea!!! It worked!!

Thanks a million. I owe you one.

Mike

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > mod_rewrite problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway