Can I create a 301 redirect from www.xcompany.com to shop.xcompany.com? - mod-rewrite

I work for xcompany. I am wondering if it is possible to set up a 301 redirect from our site http://shop.xcompany.com/ to our site http://www.xcompany.com/ and if possible, what would the rewrite rules be?
The old page that existed on the former URL has been removed from the site and a similar page has been created on the latter URL and we need to make sure any traffic is directed to the new page.
Thanks!!

RewriteRule ^old/URL/path$ http://example.com/new/path [R=301,L]

To redirect from oldsite.com to newsite.com you can use the following redirect in /oldsite/.htaccess
Redirect 301 / http://newsite.com/

Redirecting one domain to another domain is very much easier than before only if you are well familiar with CMSs like WordPress. There are plenty of redirect plug-ins available in WordPress that make our efforts easier and quicker.
301 redirection must be done if you have made any changes to the older URL and it will give link juices without losing its ranking, backlinks, and all others.
You need not worry about anything. Redirect your older one to new one. Then Google webmaster tool will give a report if your new site causes crawling errors. Hope it'd be helpful.

Related

Umbraco 7 URL rewriting

I am trying to add url rewrites
My current URL http://some_domain.co.uk/category/page_name/
I am trying to keep existing site urls functioning with below URL
http://some_domain.co.uk/category/page_name.htm
Any help appreciated.
Thanks!
i would highly recommend keeping the current URL structure, it's cleaner, and maintainability will be easier.
If your worried about the SEO or the dead links after the new site goes live then how about doing 301 redirect instead?
Umbraco has a plugin that helps you do 301 redirect and keep track of all the 404 pages, and you can view the report and 301 redirect those 404 pages.
http://our.umbraco.org/projects/developer-tools/301-url-tracker
In the example above,
http://some_domain.co.uk/category/page_name.htm
will get redirected to
http://some_domain.co.uk/category/page_name/

Revamped Joomla site to Google search engine

I am about to upload a revamped site of Joomla (update from 1.5 to 2.5 + changes).
I currently have a test bed sub-domain that I am currently working on.
In few days I am about to do the swap and replace the old site with the new one.
I am worrying about Search Engines and specifically Google.
The site currently has a very good rank (appears 2nd in the search), what actions do I have to take in order to be updated and preserve the rank? (except submitting the new sitemap I guess).
It's not a difficult task but because I don't have the option to be wrong or mistakes to be done I an asking for a more "expert" advice.
Thanks in advance.
The Upgraded version of the site have any URL changes like images or pages Then you have to take the things more carefully and redirect all old URLs to the New one with 301 redirect.
Otherwise Google will consider those pages are not exists and it will loose page rank.
Also this question is not well suits for this platform, Its better to ask on Webmaster.
In this way you will not loose old page urls ranks.
For making old non-existing URLs to new corresponding url,
on your htaccess file.
RewriteEngine on
RewriteRule your_old_url_without_domain http://www.domain.com/new_corresponding_url [R=301,L]
You're using Nginx Server so the htaccess doesn't work for try to use Nginx htaccess converter.
for more details
Hope it make sense..

WordPress File Extensions

I am converting a Frankenstein monster of a website into a Wordpress. The first challenge I am facing is to keep our old URLs for Google. this site has several .PHP pages and several HTML pages.
Our Google ranking is high in several key search terms. So it is important to me that page addresses remain the same. So far I cannot find a plugin which would allow my Wordpress site to have both .HTML and .PHP permalinks.
I am familiar with mod_rewrite() and have used it before, but when I inserted a rewrite rule into the existing Wordpress .htacces file, it broke the routing altogether.
I would greatly appreciate any input from your Wordpress gurus :)
You need to do 301 redirect and here's an example .htaccess.
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/

Wrong redirection to old site after Magento's duplication

I’ve got this problem: Magento redirection problem after moving
I changed local xml, deleted cache, changed secure and unsecure link, everything… It doesnt’ work. The only difference is that I duplicated my installation on the same server and I changed subdirectory’s name for the second installation. But I tried also on another server and is almost the same, except for the fact that it keeps linking me back to Google, and not to old domain.
I noticed that if, on the other server, I don’t change subdirectory’s name everything works (and I don’t understand why) but I want on the same server 2 identical installation with 2 identical databases. How can I? What’s the problem? How can I avoid this wrong redirect?
Magento relies heavily on caching. I've noticed in the past I've had to clear my browser internet cache before the redirects updated.
Also if you cloned/duplicated the code & database, its likely you will have the old URL's in the rewrite module. Have you tried reloading all the indexes after moving and changing the URL's in the magento configuration?
Worst case you may have to change the URL in the core_config_data table in the database.
There is no reindex required for base_url to be taken in account.
Only cleaning cache is required. Are you sure you did it well ?
What cache system are you using ?
What did you changed in your local.xml for this ?
Are you sure you didn't left old information in a local.bak.xml for example ? Magento reads every xml file in /app/etc
I have encountered this when moving, and it ended up being that my .htaccess file still had an old rewrite rule pointing to the old domain. In case someone else has this issue for which the other suggestions to not apply, look for something like this:
RewriteCond %{HTTP_HOST} !^www\.localhost\.com$ [NC]
RewriteRule ^(.*)$ http://www.localhost.com/$1 [R=301,L]
and make sure obviously that the localhost.com matches your domain (the above simply redirects with a 301 permanent redirect rewrite any request that does not begin with www.localhost.com to http://www.localhost.com/ (such as the non-www localhost.com)

Magento mini search form from secure pages

I've run into a catch-22 with the search form that hopefully someone can help me with. From any of the secure pages in our Magento store (My Account, Checkout, etc) if you use the mini search form in the header, it takes you to a secure search results page https://oursite.com/catalogsearch/result. This results in a browser warning because there is unsecure content on that page. I thought I could fix this by modifying the CatalogSearch Helper class so that the getResultUrl functions always returns an http: link. However, this results in the browser warning you that you are about to send form data over a non-secure connection. So I can't seem to find a solution that doesn't look dangerous to the user.
Any ideas?
I know this is not the proper EAV/MVC/1000 lines of XML Magento module way of doing it, however, since this is a straightforward http/https problem you can put a couple of lines in .htaccess to get your search box behaving correctly:
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^catalogsearch http://www.example.com/catalogsearch/ [R=301,L]
The right way to fix this is not to use mixed content on that page. Magento can usually handle any page over HTTPS if it is requested to do so, so find the assets that are hardcoded over http:// and fix them to respect the current protocol properly.
For me the incorrect url got stuck in cache (we had heavy cache on the live server) and that caused the security warning for me. Hope this helps someone.
The question should be - why is this happening?
Doing a search on a non-secure page will yield results on a non-secure page.
After having visted a secure page, searching on a non-secure page will yield results on a secure page - how does this make any sense? What is the purpose of this?

Resources