Reg Ex Question about Rewrite Rules
-
In this redirect rule, what does the "$1" mean?
RewriteCond %{HTTP_HOST} ^(oldsiteaustin|www.oldsiteaustin) [NC] RewriteRule ^(.*)$ http://austin.newsite.com/$1 [R=301,L]
-
I'll second that - Stackoverflow is an excellent resource for this sort of thing.
-
If you're looking to understand regex then you could read the SEOmoz post from a couple of days ago - http://www.seomoz.org/blog/an-seos-guide-to-regex - or this tutorial site is okay (if dry) -http://www.regular-expressions.info/tutorial.html
Hang out around stackoverflow as well for specific questions.
-
Aye, so, www.oldsiteaustin.com/page.html will become austin.newsite.com/page.html
-
I believe the (.*) captures the path of the original domain and $1 uses that path in constructing your redirect url. I'm replying without checking my trusty htaccess cheat sheet but this should ensure that you redirect all paths on the old domain to their new equivalent on your new domain.
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
-
Google Analytics Question - Impressions & Queries Up, Sessions Down
I'm working with a client who, according to the Google Query report, impressions and sessions are up since we've started work with them about 6 months ago, but Google sessions are down. In moz, we're seeing a gradual, but steady increase in search visibility specifically with Google. Note: this is all organic. From when we started tracking queries, the first month we were tracking there were 43,581 impressions and 690 click throughs for the month. This past month there were 98,293 queries and 1015 clicks throughs for the month (granted not year over year data) - of these 1,015 clicks, 995 of them were from web. However, for those same time periods, sessions from Google are down over 30% - 1,750 vs. 1,189. I'm not sure how to interpret this. I realize that clicks and sessions are not a straightforward comparison, but I would think that if clicks were up according to the query report that sessions would also be up. Is it that some of these clicks are bouncing and therefore not being tracked as a session? Is there a potential issue with how data is being tracked?
Reporting & Analytics | | Corporate_Communications0 -
Possible penalty question - need expert help
hallo everyone, I am posting this question to the MOZ community, because I could not find any useful information or proper advice so far, even after consulting a few local SEO experts. I noticed from the end of september a steady and consistent decrease in visits (please see attached pdf) for my website https://bastabollette.it I lost so far almost 40%. Please consider that I have not changed my habits in blog posting lately, both in quantity and quality. I have not made any subtantial change on the website lately. I did a general audit of the site asking to an expert but apart from some generic suggestions (like: "work on increasing PR, add more quality backliks, use more no-follow links, fix broken links" - things I am currently going to fix anyway) I don't really understand the reason of the drop. Please also note the strange drop of 11/22/15 (see search console screenshot). Can you please help me? thank you. Selezione_018.jpg Selezione_019.jpg
Reporting & Analytics | | micvitale0 -
Hi - I have a beginner question about organic search results dropping to zero
Really confused about a site I'm getting going on SEO with... I'm new to SEO, but I've found that the organic search results for princessdesign.co.uk have dropped to zero dramatically. I'm concerned that I've missed something and hope that somebody out there might be able to help? Any input greatly appreciated 🙂
Reporting & Analytics | | Gokart0 -
What Parameters and Rules i set to track all types of click?
Hello Expert, If i want to track all types of clicks either link, button, drop down etc for my website then what parameters i add in "Event Tracking parameters" and what will be firing rules. I already have universal analytic and google tag manager. Track Type as even i selected in google tag manager now please tell me 1) what i add in category, Action, label? 2) what should be the rule. I will be really thankful to you if you give cut to cut answer instead of sharing post.
Reporting & Analytics | | bkmitesh0 -
Google Analytics question
Hi, I recently relaunched my site on a wordpress CMS. The relaunch has gone well except for a category of traffic within Google Analytics which is referral traffic from google.co.uk (its a UK site) which has dropped off hugely. The non-paid search traffic from google.co.uk is the same or better than it was. Can anyone tell me what the difference is between referral traffic from google.co.uk and non-paid search traffic from google.co.uk. Thanks for your help. Ben
Reporting & Analytics | | benacuity0 -
Our SEO is garbage. can someone answer a few questions for me?
I've seen our SEO drop to more or less the bottom of the barrel, and I don't have any answers yet as to why. SEOMoz is running it's crawl currently, and I have a few errors about duplicate titles and content, so I know I have some work cut out for me. But, why the sudden drop? The only change I made at the time was a change to our URL structure, but all links were 301'd to their new location. Does this still hurt SEO that terribly? Also, our robots.txt file is getting indexed and showing up as the first result at times. Very embarrassing. It's doing better than our other pages. 😞 I don't get what's happening here. Yrzu3,fkbYu
Reporting & Analytics | | stagl0 -
Question for SEO experts!
I am checking my competition with all the metrics available and I have no clue why we are not coming up higher in ranking on Google. It's been 3 months and we've been bouncing between 9 and 7 position. One competitor just came out of nowhere with almost 600 internal links and few external links and occupied 3rd spot. I've built pretty good portfolio of links with links even coming from Google for crying out loud. My on page optimization is very good, we've even passed W3C with no errors. At least 3 of our competitors above us have less Domain Authority, Page Authority, Back links for external domains, number of external domains, etc... Not sure what is going on. We are not really trying to be the top dog in Google all the time, but it is the principle of a thing. Keyword is Laser Marking. Our domain starts with cms. Don't want to type the whole URL because Google might crawl (maybe a bit of paranoid at this point LOL) Any suggestions?
Reporting & Analytics | | DmitryP0 -
Overall site traffic - 3 quick questions
3 things : 1. Does Google factor in overall site traffic in rankings? So for 2 sites, all other things being pretty much equal, the one with higher traffic will be listed higher? 2. Does this logically imply that sites with lower traffic overall face an uphill struggle to be ranked highly??? 3. As an extension to this, would it be true to say that by increasing site traffic, say with Google Adwords or other online or offiline or whatever advertising, that might help get higher SEO rankings??? Thanks so much for your responses. This forum is great!
Reporting & Analytics | | inhouseninja0