|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:
(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 |
|
#2
|
|||
|
|||
|
RE: mod_rewrite problem
Try:
Code:
RewriteRule ^/story/([0-9]+)/([0-9]+).php$ /story.php?story=$1&page=$2 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
RE: mod_rewrite problem
It immedietly redirected to codewalkers.com.
|
|
#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 |
|
#7
|
|||
|
|||
|
RE: mod_rewrite problem
Yea!!! It worked!!
Thanks a million. I owe you one. Mike |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > mod_rewrite problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|