Redirect to one file

New to mod_rewrite? This is a good place to start.

Redirect to one file

Postby progression » Wed Jun 03, 2009 1:49 pm

I have looked and cannot find a solution so I have come here to hassle you peep :)

I am using code ignitor (php framework) and if you know what it is it works of the main file index.php and it sorts its extensions out itself now I want a clean url currently the address is like

www.domain.tld/index.php/1stvar/sndvar/so-on

now is there a way to mod rewrite to take out the index.php so it will look like

www.domain.tld/hey/this/looks/better

any help would be amazing :)
progression
 
Posts: 2
Joined: Wed Jun 03, 2009 1:45 pm

Postby richardk » Thu Jun 04, 2009 1:12 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ /index.php/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby progression » Thu Jun 04, 2009 1:17 pm

totaly forgot about this post sorry I found the solution which is exactly as above bar denying access to directorys
progression
 
Posts: 2
Joined: Wed Jun 03, 2009 1:45 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 118 guests

cron