Can someone interpret this entry in my htaccess file into english so that I can understand?
-
There are a number of entries in my htaccess and I'd like to understand what they are doing so that I can understand if they need to be there or not.
So, can someone tell me what this says...in plain english?
RewriteCond %{HTTP_HOST} ^legacytravel.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.legacytravel.com$
RewriteRule ^carrollton-travel-agent$ "http://www.legacytravel.com/carrollton-travel-agent" [R=301,L]Thank you a million times in advance.
-
Hello, my old htaccess buddy!
Let's say, perhaps, that a person wanted to change her main company blog from www.legacytravel.com/ramblings to www.legacytravel.com/blog.
Of course, all of the traffic would need to be re-directed. the htaccess currently says:
BEGIN WordPress
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /ramblings/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ramblings/index.php [L]</ifmodule>END WordPress
Would it be appropriate / effective to add something there that directs everything in light of the renaming of that subfolder?
Again, thank you in advance.
-
Yep. Of course, as with any change, back the old rules up into a text file before making the move... just in case it explodes everything (but it won't). Just a precaution.
-
Alright, so if I take out all of the other nonsense...and just put this in...will that just make it go from legacytravel.com to www.legacytravel.com?
and that's that?
-
Sorry to disappoint, Travis. Nothing too complicated, looks like it was just a botched www cleanup. A good old:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^legacytravel.com [NC]
RewriteRule ^(.*)$ http://www.legacytravel.com/$1 [L,R=301]Will do the trick.
-
It doesn't force www in any instance. That's why I'm looking forward to the solution.
-
Hi,
That line of htaccess says:
If the host is legacytravel.com OR www.legacytravel.com, then lets try this rule below.
One conditions will always be true since the htaccess is on your site. So they cancel each other out, and are not needed.
The rule says if the URI matches the regular expression '^carrollton-travel-agent$' then redirect (r=301) to the target URL and stop processing rules (L flag for last)
Your RewriteRule target doesn't need characters escaping because it is not a regular expression, just a URL to redirect to. You also don't need the quotes, they're useful for grouping arguments with spaces in them but that's not affecting it.
Really this rewriterule doesn't accomplish anything, it redirects /carrollton-travel-agent to /carrollton-travel-agent, forcing the www. no matter which version is accessed. But if that is what you're wishing to achieve then there's a much simpler solution:
RewriteCond %{HTTP_HOST} !^www.legacytravel.com$ [NC]
RewriteRule ^(.*)$ http://www.legacytravel.com/$1 [R=301,L]
Notice we only use the \backslash to escape characters in regex patterns, and not in our target URL. What that rule will do is redirect any visitor where the host is missing the www to the equivalent page with the preceding www.
Hope that helps.
-
Would like to hear the resolution, given my endorsement.
-
Escaping characters isn't a big deal with newer version of Apache. No need for all those slashes, unless it's something more complex. From what I've seen, at least.
-
You got it.
Again, thank you so much for taking a look.
-
Alright... just give me a day or two since you don't have me on retainer
-
Alright...I just sent the whole redirect portion of the htaccess file to WilliamKammer.
Thank you so much, everyone, for your help.
-
I'm guessing you want to escape regex characters with a ? XD I just want to say again, that regex101 is a good resource. So thanks for sharing that.
-
I'm determined to master htaccess and regex... feel free to pm me the file
-
William may well be correct. I'm far from a Joomla! expert, I generally fix Joomla! problems by migrating to WordPress, so I don't know how that framework/CMS handles redirects. I'm not exactly criticizing Joomla!, but these things shouldn't be a problem. (Redirects are generally handled on the server level, I just don't know about Joomla!.)
This sounds like it's been around for a while, so it might not be a DNS issue, but keep that in your possible bucket.
Would you give one of us the entire .htaccess file via PM? I would prefer William, because he does these things for free all the time. Alternately, you can check it out yourself with http://htaccess.madewithlove.be/.
It's really funny though. I must have driven by your place a number of times. I used to live on Preston, about a mile away. It's Grapevine for me, these days. The place is a little more my speed.
-
It looks like the rule is attempting to rewrite www.legacytravel.com and legacytravel.com to legacytravel.com/carrollton-travel-agent, but it's not working. This is likely due to the piece on line 3 before the final URL (unless the person was attempting something else I'm not familiar with). Others issues could be the rewrite engine not being turned on, the .htaccess file being in the wrong place, or some other issue, like server settings.
-
The first two lines are the condition. It is saying if anyone comes to legacytravel.com or www.legacytravel.com then it is looking for this string carrollton-travel-agent if that string is found, then it will rewrite the url to http:\www.legacytravel.com/carrollton-travel-agent I don't really know why that rule is in place, but I am not familiar with the site.
You can learn about what the symbols in the htaccess mean here, http://perishablepress.com/stupid-htaccess-tricks/
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
-
Robots File
For some reason the robots file on this site: http://rushhour.net.au/robots.txt Is giving this in Google: <cite class="_Rm">www.rushhour.net.au/bootcamp.html</cite>A description for this result is not available because of this site's robots.txtLearn moreCan anyone tell me why please?thanks.
Technical SEO | | SuitsAdmin0 -
How can you best use additional domains with important keywords
Currently I have a corporate website that is ranking all right. However, I have some additional domains containing import search terms that I would like to use to get higher rankings for the corporate website, or allow these domains to generate more traffic for the corporate website. What are best practice in using these domains with keyword terms, to make most use of them, for ideally both ranking as well as generating additional traffic. All input is highly appreciated.
Technical SEO | | moojoo0 -
Why can no tool crawl this site?
I am trying to perform a crawl analysis on a client's website at https://www.bravosolution.com I have tried to crawl it with IIS for SEO, Sreaming Frog and Xenu and not one of them makes it further than the home page of the site. There is nothing I can see in the robots.txt that is blocking these agents. As far as I can see, Google is able to crawl the site although they have noticed a significant drop in organic traffic. Any advise would be very welcome Regards Danny
Technical SEO | | richdan0 -
Can't find mistake in robots.txt
Hi all, we recently filled our robots.txt file to prevent some directories from crawling. Looks like: User-agent: * Disallow: /Views/ Disallow: /login/ Disallow: /routing/ Disallow: /Profiler/ Disallow: /LILLYPROFILER/ Disallow: /EventRweKompaktProfiler/ Disallow: /AccessIntProfiler/ Disallow: /KellyIntProfiler/ Disallow: /lilly/ now, as Google Webmaster Tools hasn't updated our robots.txt yet, I checked our robots.txt in some ckeckers. They tell me that the User agent: * contains an error. **Example:** **Line 1: Syntax error! Expected <field>:</field> <value></value> 1: User-agent: *** **`I checked other robots.txt written the same way --> they work,`** accordign to the checkers... **`Where the .... is the mistake???`** ```
Technical SEO | | accessKellyOCG0 -
How can we fix duplicate title tags like these being reported in GWT?
Hi all, I posted this in the GWT Forum on Monday and still no answers so I will try here. Our URL is http://www.ccisolutions.com
Technical SEO | | danatanseo
We have over 200 pages on our site being flagged by GWT as having
duplicate title tags. The majority of them look similar to this: Title: <a>JBL EON MusicMix 16 | Mixer | CCI Solutions</a> GWT is reporting these URLs to have all the same title: /StoreFront/product/R-JBL-MUSICMIX.prod/StoreFront/product/R-JBL-MUSICMIX.prod?Origin=Category/StoreFront/product/R-JBL-MUSICMIX.prod?Origin=Footer/StoreFront/product/R-JBL-MUSICMIX.prod?Origin=Header/StoreFront/product/R-JBL-MUSICMIX.prod?origin=../StoreFront/product/R-JBL-MUSICMIX.prod?origin=GoogleBase These are all the same page. There was a time when we used these origin codes, but we stopped using them over a year ago. We also added canonical tags to every page to prevent us from having duplicate content issues. However, these origin codes are
still showing up in GWT. Is there anything we can do to fix this problem. Do we have a technical issue with our site code and the way Google is seeing our dynamic URLs? Any suggestions on how we can fix this problem? The same is true in our report for Meta descriptions. Thanks
you,
Dana Tan0 -
Can duplicate [*] reports be suppressed?
That's the best question could come up with! Have searched but can't find any info. New user: First crawl error report show listings of pages with same titles/descriptions. In reality they are all the same page but with different parameters eg Email_Me_When_Back_In_Stock.asp?productId=xxxxxxxxx etc These have been excluded in both robots.txt (for some time ie disallow: /*?)and google webmaster tools (just done). Will they still show in updated report and if so is there a way to suppress them if the issues have been rectified as can be done in webmaster tools. Is there a way to test to see if they are being excluded by robots.txt and GWT?
Technical SEO | | RobWillox0 -
Can Google read text in Javascript?
We have just completed the redesign of our product page, which you can see here: http://www.uksoccershop.com/p-19045/2011-12-Chelsea-Adidas-Away-Football-Shirt.html Because we want the select size / add to basket section to appear prominently, you can see we are showing only a snippet of the product description in this section and then user has to click "more" to see it. My question is, can Google read the product description here since it's in Javascript? The code is as follows: 2011-12 Chelsea Adidas Away Football Shirt £44.99 Item Code:379606 Brand new, official Chelsea away shirt for the 2011/12 Premiership season, available to buy in adult sizes S, M, L, XL, XXL, XXXL. This football shirt is manufactured by Adidas and is black in colour.[ More...](javascript:void(0);) Brand new, official Chelsea away shirt for the 2011/12 Premiership season, available to buy in adult sizes S, M, L, XL, XXL, XXXL. This football shirt is manufactured by Adidas and is black in colour. Cheer on the Blues in style in the new adidas Chelsea Away Shirt, featuring a striking blue blocked design on an imposing black background complete with the club crest and adidas logo embroidery across the chest for a great style on or off the pitch. The new Chelsea Away Shirt is designed with adidas' ClimaCool technology to bring moisture away from your skin, keeping you cool, comfortable and performing at your best as you emulate the skills of Frank Lampard, Fernando Torres and John Terry on the pitch. Customise your shirt with Premiership shirt printing for your favourite Chelsea stars or choose your own custom name and number. Adult Football Shirt
Technical SEO | | ukss1984
Short sleeves soccer jersey
Chelsea club crest to left chest
adidas logo and stripes
Print sponsor to centre
ClimaCool technology
Machine washable Product code: 379606 The 2011/12 Chelsea away football kit is released on 7th July 2011. <form name="currenychange" action="http://www.uksoccershop.com/p-19045/2011-12-Chelsea-Adidas-Away-Football-Shirt.html" method="get">
<select class="topselectbox" onchange="this.form.submit();" name="currency" style="float:right;"> <option value="USD">US Dollars</option> <option value="EUR">Euro</option> <option value="GBP" selected="selected">UK Sterling</option> <option value="AUD">Australian Dollars</option> </select>
</form> Available Now [Be the first to ask a question](javascript:void(0); "Ask a Question")
[Be the first to review this product](javascript://) Rating: 5 out of 5 stars <form name="cart_quantity" action="http://www.uksoccershop.com/p-19045/2011-12-Chelsea-Adidas-Away-Football-Shirt.html?number_of_uploads=0&action=add_product" method="post" enctype="multipart/form-data"> Which parts of this is Google going to be able to read? Should we make the product title our H1 header for this page and can it currently read that within the code above? </form>0 -
How I can deal with ajax pagination?
Hello! I would like to have your input about how I can deal with a specific page in my website You can see my page here As you can see, we have a list of 76 ski resort, our pagination use ajax, wich mean we have only one url, and just below the list, we have a simple list of all the ski resort in this mountain, which show all the 76 ski resorts.. I know it's quite bad, since we can reach the same ski resort with two différents anchors links. Thanks you very much in advance, Simon
Technical SEO | | Alexandre_0