FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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]
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
Related topics
Programming Help & Support Guidelines
Does frihost have mod_rewrite?
mod_rewrite
.htaccess i mod_rewrite
Dynamical websites and search engines
mod_rewrite in Apache and how does it work?
.htaccess instead of mod_rewrite
[SOLVED] Using mod_rewrite.
only .htaccess instead of mod_rewrite
problema con el mod_rewrite en wmserver 3.3
[PHP] mod_rewrite
75FRIH$ Mod_Rewrite Code
mod_rewrite
Apache mod_rewrite
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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