FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Mod_Rewrite trouble

 


Marston
Code:
RewriteEngine On
RewriteRule ^http://xzact.frih.net/error/([A-Za-z0-9-]+)?$  http://www.xzact.frih.net/error.php?id=$1   [L]
This is my .htaccess file. When I try to visit the rewritten url, it just loads the default case for the error page...

Help?
AftershockVibe
Is your .htaccess file in the correct directory. Namely "/error" ?
devroom
Code:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (/|\*)$  [NC]
RewriteRule ^error.php

Try this. I should be more like this
Marston
devroom wrote:
Code:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (/|\*)$  [NC]
RewriteRule ^error.php

Try this. I should be more like this
Gives me a 500 Internal Server error.

AftershockVibe: ... I'm rewriting the error.php?id$1 TO error/(.*)... I don't need to put the .htaccess into what is basically a non-existant directory.
deepak
Try below one
Code:

RewriteEngine On
RewriteRule ^http://xzact.frih.net/error/(.*)$  http://www.xzact.frih.net/error.php?id=$1 [L, NC]


Last edited by deepak on Sat Jul 08, 2006 3:59 pm; edited 1 time in total
dickyzin
I'm having problem with my mod_rewrite too.

This is in my .htaccess file:

RewriteEngine On
RewriteRule jokes\/(.*) jokes.php?page=$1 [L,NC]

But when I goto myurl/jokes/ it gives me 404 Not Found error.

Can anyone help me?
dickyzin
I figured out the problem already.

The problem was that I had file called jokes.txt and since jokes.txt could be accessed through /jokes [without the .txt extension], it clashed with my /jokes/ mod_rewrite. Now that I've renamed jokes.txt to joke.txt, my problem has been solved. =)
deepak
@Marston ... I've tried this and its working fine

Code:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.xzact.frih.net$ [NC]
RewriteRule ^(.*)$ http://www.xzact.frih.net/$1 [R,L]
RewriteRule ^error/(.*)$ /error.php?id=$1
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.