Apache Rewrite Verse Redirect
-
I put in a request with my IT team to implement some 301 redirects. We recently launched a major redesign and there multiple version of some pages with different URLs.
They asked why they could not do Apache Rewrites, so it was not necessary to return an HTTP header.
I know Google's Webmasters best practices is to use 301 redirects. I am not familiar with the technical aspects of Apache et al.
Are there advantages to using a rewrite? Thanks
-
This is true. The rewrites using [R=301,L] are great when it is necessary to use a regex to perform the 301's with fewer entries in your .htaccess
-
It depends on the type of Rewrite Rule. If you have [R=301,L] at the end of the rule, it does the job and passes link juice.
-
A rewrite passes no link juice from the old page to the new. Whereas a 301 does. In .htaccess the code is simple:
Redirect 301 /oldpage.html /newpathto/newpage.html.
Cheers!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Redirects for new website
Hi Moz community,
Technical SEO | | JSimmons17
I'm a fairly new SEO Specialist with a brand new website. We initially had a very basic holding website until the fully functional website was completed. I have to do some redirects as we have both .html and .php files & we don't want to lose SEO value for specific pages (like the index, news, etc). I also want to redirect from a www url to a non-www url. I am trying to accomplish redirects with the following code: RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mywebsite.com [NC]
RewriteRule (.*) http://mywebsite.com/$1 [R=301,L] RedirectMatch 301 /index.html (.*).(php|html) http://mywebsite.com/index.php RedirectMatch 301 /cupcakes-slideshow/glutenfree-slideshow.html (.*).(php|html) http://mywebsite.com/gluten-and-glutenfree.php RedirectMatch 301 /press.html (.*).(php|html) http://mywebsite.com/news-and-reviews.php Please let me know if I am on the right track. Thanks so much in advance!0 -
Nginx vs. Apache, All Things Considered
Hey Peeps, I've been struggling lately with a new static site, and I'm looking for anyone's opinion who's had to optimize a site using Nginx. I understand that Nginx is recommended for static sites, however I want to avoid being in a situation where I can't do things like write redirect rules the way I want to. Considering that it will be hosting a Static site, are there any features or functions that Nginx lacks when compared to Apache, such as ability to write rewrite rules, etc.?
Technical SEO | | danny.wood1 -
To 301 redirect or not...
Hi guys i'd like to get your opinion on this. We currently have two sites, site A is the old one with PA44 and DA33. Site B is the new one which is going to replace site A it currently has PA37 and DA24 Our plan for the future is to shut down site A and redirect all pages using 301 to the relevant pages on side B. Currently we have some links in place for a couple of keywords on site A to site B which seems to be working great for our ranking. Now i'm wondering if this is maybe a good option, to give back links from A to B or will i pass through more link juice when redirecting everything? (ps. both are e commerce sites hosted and registred with different companies)
Technical SEO | | Immanuel0 -
How do i actually use the canonicalization rule for Apache?
Hi Guys, Moz is reporting lots of duplicate content on my site. I think this is partly from session id's and partly from category pages and on-site search generated pages. I know I have to use the canonicalization rule but don't know exactly how to determine the correct URL and where to put the code. Can anyone offer any advice on this? I'm new to this so apologies for any etiquette breaching etc. Many thanks, Stewart.
Technical SEO | | oiljob0 -
301 redirect from Blogger
Hello, I have a client with a Wordpress network of blogs, each blog is owned by a different blogger. Many of them were migrated time ago from Blogger. I have seen that the way used to redirect them is a meta refresh, so no authority is being passed. I cannot find any reliable way of making a 301 from Blogger, There are some plugins, but I'm afraid of using them. Any of you have experience with this situation please? I have even thought about placing a global rel canonical before the meta refresh, but I think that here the problem is the meta refresh itself.... Thank you in advance
Technical SEO | | Juandbbam0 -
Redirecting Parked Domain
I just recently switched hosting. We have 3 domains and 1 being the main domain. Right now they are set up as parked domains. Can I redirect the parked domains under my main websites .htaccess file ? I am just worried that good we will get hit for duplicate content, even though technically the content is only on our main domain. right now if I type in my parked domains in Google, they appear in search. The site is all hand coded and not using a CMS.
Technical SEO | | hfranz0 -
When is it safe to remove 301 redirects?
I have created over 500 301 redirects in my .htaccess file, some of them are more than 2 years old now. Should I delete them? I don't like seeing the "notices" number in crawl diagnostics so high 😞
Technical SEO | | danielshaw0 -
Redirection help to retrieve broken links
Hi, my hosting company after they updated my joomla website lost thousands of pages of content, i am now searching for all broken links and re doing the content to get my links back, but i am having a problem understanding how to redirect these links. For example, i have now managed to retrieve this page http://www.in2town.co.uk/news/have-your-say/liberal-dem-leader-says-he-will-be-the-next-prime-minister-what-do-you-think but the old url for this page was http://www.in2town.co.uk/Have-Your-Say/Liberal-Dem-Leader-says-He-Will-be-The-Next-Prime-Minister-What-Do-You-Think/menu-id-4953 i do not have the unfriendly url for this page, so what i am trying to find out is, how to tell google that the above page is now http://www.in2town.co.uk/news/have-your-say/liberal-dem-leader-says-he-will-be-the-next-prime-minister-what-do-you-think in my joomla site. if anyone could please explain how to do this with joomla 1.5 then you will make me very happy as then i will be able to retrieve some of my lost links
Technical SEO | | ClaireH-1848860