FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need help with mod_rewrite





rohan2kool
i want to rewrite urls of the form: http://tritium.frihost.net/projects/simple/[anything] to => http://tritium.frihost.net/projects/simple/index.php/[anything] . [anything] here, well.. can be anything.

also, i want it NOT to redirect a url of type: http://tritium.frihost.net/projects/simple/index.php/[anything].

please help.

thanks,
rohan
adeydas
so what you basically want to achieve is http://tritium.frihost.net/projects/simple/[anything] to http://tritium.frihost.net/projects/simple/index.php/[anything]

Try this code
Code:

RewriteEngine ON
RewriteRule ^simple/([A-Za-z])/$ /simple/index.php/$1 [R]
Stubru Freak
adeydas wrote:
so what you basically want to achieve is http://tritium.frihost.net/projects/simple/[anything] to http://tritium.frihost.net/projects/simple/index.php/[anything]

Try this code
Code:

RewriteEngine ON
RewriteRule ^simple/([A-Za-z])/$ /simple/index.php/$1 [R]


I would add 0-9, dash and underscore to that, just in case.
Code:

RewriteEngine ON
RewriteRule ^simple/([A-Za-z0-9 _-])/$ /simple/index.php/$1 [R]


The code should be placed in a file named .htaccess in the projects directory.
rohan2kool
i'm getting an Internal Server 500 error when i do that..
Stubru Freak
rohan2kool wrote:
i'm getting an Internal Server 500 error when i do that..


Yes, it could be wrong, change it to this:
Code:
RewriteEngine ON
RewriteRule ^simple/([A-Za-z0-9 _-]*)/$ /simple/index.php/$1
mahirharoon
[offtopic]
sorry for being a bit offtopic
i am running a server on my xp
i could not make a file with no file name
so i could not do it
Stubru Freak
mahirharoon wrote:
[offtopic]
sorry for being a bit offtopic
i am running a server on my xp
i could not make a file with no file name
so i could not do it


Yes you can. You can make it in cmd, or rename it on a different server and then download it again, or download an example .htaccess somewhere and edit it.
AftershockVibe
Windows doesn't like you creating new files which being with "." so explorer won't let you.
Fortunately you can work around this by using "save as..." in Notepad (or whatever) and typing your filename beginning with a "." in.
Fire Boar
Yes, there are numerous workarounds. With XP, I'd imagine you're using either XAMPP or WAMP. If so, you could also just copy an existing .htaccess file (from the default stuff) and change it.
mahirharoon
Fire Boar wrote:
Yes, there are numerous workarounds. With XP, I'd imagine you're using either XAMPP or WAMP. If so, you could also just copy an existing .htaccess file (from the default stuff) and change it.

correct i use wamp,
Related topics
can i help?
help,Bonding
HELP!!
Help me with MySQL Account Maintenance and phpBB 2.0.15 :((
mod_rewrite
help, change pass my acc in cpanel
help me upgrade php to 5.
help with mod_rewrite
Apache mod_rewrite
need help with mod_rewrite rules
Need help with file permissions for WordPress & plugins
mod_rewrite help
Struggling with mod_rewrite
HELP in .htaccess file modified
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.