i wanna change the domain name and redirect all archived links to the new one not only the main page for examble http://www.web-design-wiki.com/ to http://www.kootta.org and all the rest for examble http://www.web-design-wiki.com/php-tutorial.html to http://www.kootta.org.php-tutorial.html i know i have to edite the .htaccess file but i don't know how to achieve it i have a live example for the same thing i wanna do is redirecting all google archived links from the following domain http://www.fomny.com/ to http://www.watchfomny.com sorry for my english it's not my language
yeah, on your old domain, place this in .htaccess RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] Code (markup): The (.*) means any string, ^ and $ beeing the delimiters for the url used in the rewrite. Followed with the new domain, with $1 at the end ( the anything (.*) stored previously) Followed by the last tag [R=301,L] , which includes R=301 for a "301 Moved Permanently" redirect. ~~~~~~~~~~~~~~ On the new domain, also add this with www or without www, uses the same method: # Always www RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] it will prevent to have 2 indexed result for each page (with/without www) or have inconsistencies in your incoming links. With the moved permanently, you shouldn't lose any benefits. you can also do this with subdomains, which often end up beeing accessible as subdomain.domain.com or domain.com/subdomainfolder ~~~~~~~~~~~~~~ Lots of nice protections and tweaks that can be done in .htaccess Custom not found pages... clean urls... block query strings...