301 in CodeIgniter? question

Options +FollowSymlinks
RewriteEngine on

RewriteCond $1 !^(index\.php|assets|uploads|tt|application/modules/.*/assets|resources|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php?/$1 [L]    

Redirect 301 /testurl /home/ 

This is my .htaccessredirect verification file 301in my CodeIgniter project.

Redirecting 301works fine, but the problem is with the URL. When I try ...

http://parcmobilenew.eworkdemo.com/testurl

... it redirects to the main page as indicated in .htaccess, but asks for the url in the query string like this ...

http://parcmobilenew.eworkdemo.com/home?/testurl

How can I do .htaccessnot do this when redirecting?

+4
source share
1 answer
  • Do not mix the rules Redirectwith mod_alias.
  • .

:

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^testurl/?$ /home/? [L,NC,R=301]

RewriteCond $1 !^(index\.php|assets|uploads|tt|application/modules/.*/assets|resources|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]

, 301 .

+3

All Articles