• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.htaccess 301 redirect

#1
[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.

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.