CodeIgniter Forums
.htaccess 301 redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: .htaccess 301 redirect (/thread-54385.html)



.htaccess 301 redirect - El Forum - 09-06-2012

[eluser]Unknown[/eluser]
Hi everybody.

I need to redirect old urls to new ones and make www-redirect to www-less url using .htaccess


My .htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|images|gallery-images|articles-images|css|js)
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{HTTP_HOST} ^www.domain.com\.ua
RewriteRule ^(.*)$ http://domain.com.ua/$1 [R=permanent,L]

Redirect 301 /old-link http://domain.com.ua/newlink


I received such problems:
www.domain.com.ua - domain.com.ua/index.php?/ (why index.php? appears?)
domain.com.ua/old-link - domain.com.ua/newlink?/old-link (why old link appears in the end and no redirection happens)

Please, need help.



.htaccess 301 redirect - El Forum - 09-11-2012

[eluser]Unknown[/eluser]
Any ideas? Maybe somebody post his working .htaccess? I will be appreciate for it.