I migrated my e-commerce site oscommerce to open-cart and my old links coming to the open-cart site. whenever old links requested open-cart redirects to the homepage if the pattern is like this .../index.php?manufacturers_id=...
I changed .htacess file to exclude redirect to the homepage by defining these lines
RewriteCond %{REQUEST_URI} manufacturers_id
RewriteRule .* NOT.php
if requested url contains manufacturers_id "it will" redirect to NOT.php instead homepage. But these .htaccess definitions don't work
I also want to cancel 404 pages I prefer to use the server default error page.
How can I make this? Thank you
Related
I'm trying to set up a permanent redirect from an old http page to an entirely new domain. The http site where the old page was is now https.
Example-
I would like to Redirect this page:
http://example.net/productpage/
To go to this:
https://newwebsite.com/
I have found similar questions although the answers aren't working for me. Not personally come across this particular issue before. Currently, while working on redirects I have a 404 to homepage redirect plugin on the WP website. But the original http://example.net/productpage/ is in a printed document so not ideal.
After researching I have tried a couple of suggested methods to .htaccess under RewriteEngine On
RewriteRule ^productpage/$ https://newwebsite.com/ [R=301]
and also:
RewriteCond %{http_host} ^example.net$
RewriteRule ^productpage\$ https://newwebsite.com [R=301,L]
Basically, trying to get the old http page to direct users to another https website
Try this in your .htaccess file
RewriteEngine On
Redirect /productpage https://newwebsite.com/
I have a mirrored site and I need all the visitors to be redirected to a certain page other than the original homepage. But the original site (not the mirror) should continue to behave without changes. Therefore, I need to include a redirect rule in my .htaccess based on the referrer. If the visitor targets the mirrored site, I need to redirect. If the visitor lands at the original site, nothing should be done.
How do I implement this?
If you have the following setup:
fancysite.com - your main site with all the pages
coolname.com - a site that should redirect all requests to your main site
For example, a user requesting www.coolname.com/infos/january.html should be redirected to www.fancysite.com/infos/january.html.
This redirect should be done with a 301 HTTP response (moved permanently) for several reasons, e.g. google preferring it.
To do this on an Apache server, you put a .htaccess file in the root directory of your website (may differ from the root of your account). The server must have the module mod_rewrite and you must have the rights to use it.
Put the following in your .htaccess to redirect all requests, as you do not want to update it for every new page you put on your site:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !fancysite.com$ [NC]
RewriteRule ^(.*)$ http://www.fancysite.com/$1 [L,R=301]
The module mod_rewrite is very powerful, have a look at the documentation, if you have the time:
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
I have a Joomla site with a blog attached to it.
I created a new homepage for it, though, that uses just plain html and have uploaded it to the /new/ directory. I'm trying to write an htaccess redirect that will allow me to use the /new/ directory just for the homepage, but still use the Joomla part for the blog.
Here's what I have tried so far, but it doesn't work.
RewriteCond %{REQUEST_URI} !^/new/
RewriteRule ^ /new/ [L]
This actually redirects it in the browser to /new/ instead of doing it underneath the hood, invisibly. Also when I go to the /blog/ page, it is very messed up. In sum:
domain.com --> domain.com/new/ (but don't show the redirect)
domain.com/* --> allow joomla to do its thing
I couldn't get #anubhava solution to work, so I just moved my whole joomla installation into the /blog/ folder. There are just a couple of changes that you have to make in the configuration.php file. After that I put my new site in the root folder.
I expect this to be a simple answer, yet it is a question I have been struggling to confirm after searching on Google and through similar questions.
I am wanting to make sure that my site has a 301 redirect in place to redirect my website URL (example.com) to (www.example.com). When I type in the browser my URL without (www.) in front of it, my page opens as (www.example.com) which is good, however how can I be certain that Google sees this as a redirect for SEO purposes?
I have not added any redirects to my site, so unless my version of Magento (1.7.2) has this redirect already set up or the theme I am using has this redirect set up, then it won't be set up.
I have read that I will have to redirect every page, not just the Home page. I am also aware of the URL Rewrite Management tool in the Magento backend, but I don't know whether I need to add rewrite there or whether I need to enter them into the sitemap.xml or .htaccess file so that Google knows I want my links redirected to the (www.example.com) URL.
Thanks
It will be better direct using htaccess
# Redirect non-www to www:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/
Also,changed in url of secure and unsecure url of magento instance
to
www.example.com ,for please go to admin>system>configuration>General>Web>
I've recently removed the .php extension from all of my pages.
Google results are still showing:
www.mysite.com/page.php
www.mysite.com/directory/page-example.php
These are now dead links. The new ones are:
www.mysite.com/page
www.mysite.com/directory/page-example
What would be the appropriate redirect so that if someone clicks one of the .php URLs, they are redirected to the extension-less URL
Use <link rel="canonical" href="FULL_PROPER_URL" /> in your web pages. This will tell Search Engine to use that URL when displaying search results and will treat this a s main URL when seeing duplicate URLs. Details are here:
http://www.google.com/support/webmasters/bin/answer.py?answer=139394
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
Use 301 Permanent Redirect. Please note that this WILL NOT stop Google or any other search engine to requesting .php pages if such link is publicly available on some other site.
This needs to be placed in .htaccess file in website root folder. If placed elsewhere some tweaking may be required.
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
# redirect to .php-less link if requested directly
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.php\sHTTP/.+
RewriteRule ^(.+)\.php $1 [R=301,L]
The above rule will do 301 redirect to a php-less URL. It will only redirect if .php file was requested directly and will not touch already rewritten URLs.