Welcome Guest, Not a member yet? Register   Sign In
Problem rewriting links in htaccess
#3

(02-05-2015, 07:57 AM)chiefdongas Wrote: Hey, I have "index.php?" in my links, I have searched for a solution all over the forum
and I could'nt find something that works for me.

"http://mywebsite.com/index.php?video/xxxxxx"
I am trying to change it to "http://mywebsite.com/video/xxxxxx"

now, I have tried to it in htaccess with no success.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

What I am doing wrong? HELP Exclamation  Exclamation

First thing is if you are using the link helper --> anchor() function and are still getting an index.php in your links, that means you have to go to your config file and update your index page --> Go to your application/config/config.php file ->Go to about line 30 and change:

PHP Code:
$config['index_page'] = 'index.php';

// to:

$config['index_page'] = ''

Also i'm not great with .htaccess rules but here is mine that works:

Code:
<IfModule mod_rewrite.c>
    
    Options +FollowSymLinks
    RewriteEngine on
    
    # Send request via index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php?/$1 [PT,L]

</IfModule>
Reply


Messages In This Thread
RE: Problem rewriting links in htaccess - by egall8 - 02-05-2015, 09:07 AM
RE: Problem rewriting links in htaccess - by Sky - 02-06-2015, 02:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB