WordPress and Redirects
-
I just converted my site to wordpress. Previously urls like www.waikoloavacationrentals.com/kolea-rentals/9g and www.waikoloavacationrentals.com/kolea-rentals/9g.html would go to the same page. Since using wordpress the first one will not work. I did not have redirects set up so was wondering if there is something I am forgetting to easily make it to where if someone types in both urls it will go to the same page.
-
Pages load correct at: http://www.waikoloavacationrentals.com/kolea-rentals/9g.html
And do not load at: http://www.waikoloavacationrentals.com/kolea-rentals/9g
So you need to Redirect http://www.waikoloavacationrentals.com/kolea-rentals/9g TO http://www.waikoloavacationrentals.com/kolea-rentals/9g.html
You can do this with the line of code in .htaccess
Redirect 301 /kolea-rentals/9g http://www.waikoloavacationrentals.com/kolea-rentals/9g.html
Let us know if that works?
You can also try the redirect plugin, although personally I prefer using .htaccess for redirects
-
Still no luck on this one if anyone else has any insight.
-
I sent it over.
-
Mind PMing me your. Htaccess?
-
That is what I originally had. I put it back.
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.).html\ HTTP/
RewriteRule . http://localhost/html/%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.)\ HTTP/
RewriteRule . %1.html [L]</ifmodule>Try clicking on www.waikoloavacationrentals.com/kolea-rentals/9g and you will see what happens. Thanks,
-
don't put your URL in for line 4, keep it as "localhost" like in the example.
-
Yes. I am not getting anything on www.waikoloavacationrentals.com/kolea-rentals/9g
I don't really care which way the rule goes just as long as when they put in either url they get something.
Here is the code incase I typo'd something.
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.).html\ HTTP/
RewriteRule . http://www.waikoloavacationrentals.com/html/%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.)\ HTTP/
RewriteRule . %1.html [L]</ifmodule> -
Thanks! Although, yeah, not very easy to play with.
-
The code above will do the opposite.
domain.com/page.html will become domains.com/page
Did you test for that? Usually this is how people prefer their URLs to be, and if they type in the .html, they'll still get to the page.
-
Thanks for the feedbacks. I tried the above code. I also tried a few at the website above and did not have any luck. Just to confirm what I am trying to do......Take a page like www.waikoloavacationrentals.com/kolea-rentals/9g.html. If someone types in www.waikoloavacationrentals.com/kolea-rentals/9g I want it to go to www.waikoloavacationrentals.com/kolea-rentals/9g.html so that they do not get a blank page. It was happening on my old site, but not having the same luck with wordpress. Thanks again!
-
Curly brackets between the unlink and bold portions of the kitchen sink. Apparently you have to make sure you've said what you need to say, because I couldn't find a way to intuitively shut off the block and type.
-
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.).html\ HTTP/
RewriteRule . http://localhost/html/%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.)\ HTTP/
RewriteRule . %1.html [L]</ifmodule> -
I've never done this specific rule, but it would definitely be a rewrite rule in your .htaccess file in your root. You can give this piece a shot:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*).html\ HTTP/
RewriteRule .* http://localhost/html/%1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /html/(.*)\ HTTP/
RewriteRule .* %1.html [L]
Jeez.... how do I get rid of all the extra spacing?!
Anyway, if that doesn't work, there are some other options here: http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url
And if you need to customize the regex a bit, this can help: http://www.regexr.com/
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
-
Should I do multiple 301 redirects?
We launched our website less than a year ago. We had another domain name and business name. I created 301s from the old domain to the new domain, that are still in place now. We are in the process of restructuring our current site which would result in pages getting a new title and URL to match. Essentially it would look something like this:
Web Design | | MAVENTRI
-- olddomain.com/page1 --> newdomain.com/page1 --> newdomain.com/newpage I recently checked the analytics and it looks like we are still getting traffic redirected from the old domain. What is the best way to handle these redirects? Should I redirect a redirect?0 -
Need to find a wordpress theme
Hi, while browsing i found a wordpress website (http://www.zoompondy.com/). This website was really nice. Explored about the theme and unable to find the theme name. Even, I Tried WP theme detector. No solution. Please assist me in finding this theme.
Web Design | | jkovalan0 -
Switched from Wix to Wordpress dreaded hashtag URL
Recently took over managing a site for a non-profit which was using the dreaded Wix. Switched over to Wordpress but now Google still has the old URL's with the hashtag. Can't forward them in .htaccess and don't want to add javascript for fear of slowing down load time. I found a solution that seems like it will take hours and hours of work. I found the solution at http://www.thedriversgarage.com/web-technology/redirecting-hashbang-urls-wix-urls/ but it seems like it would take hours with all the URL's. I submitted an XML sitemap in Google webmaster tools. My question is, how serious could this effect SEO for my site? Google accepted the new sitemap but still has the old URL's in SERP. How long does this generally take to remove? Will the hashtag URL's penalize the site for duplicate content? If so is there a way to tell Google the homepage without hashtags is the page with original content? Sort of like the rel=canonical tag which I know wont work as the hashtag URL's all redirect to the homepage so they will all have the tag. Does Google ignore the hashtag? Could there even be a benefit to this, possibly the homepage getting more page authority due to the redirects? How serious is this? Thanks in advancing.
Web Design | | limited70 -
‘80-90% of SEO already done for you in Wordpress’ Am I missing something?
Hi there, I’m looking for some feedback on a statement made on my Facebook Page re Wordpress and SEO. Please understand I wouldn’t class myself as an expert but I am competent and achieve satisfactory results for clients, more so since becoming a SEOmoz Pro user, I’ve just had some great results for a client using SEOmoz guidelines in ‘On Page SEO Reports’ thank you very much! A comment however made on my FB page has got my interest…. “as you (kn)no(w) google loves WP and will get listed quicker as 80 to 90% of your SEO is already done” Does Wordpress (or Joomla for that matter mentioned in the same conversation) have some SEO advantages that Google loves as the poster would have me believe, can I save time and effort working in word press from an SEO point of view? I use the age old techniques of targeting key phrases and words and distributing them accordingly. Creating internal link structures with ‘key worded anchor text’ etc before embarking on any off page SEO. Do any of you vastly experienced (in comparison to me) SEO folk have any insight into what this statement refers to? I did not gather any references to SEO advantages in Wordpress or Joomla in the Enge and Fishkin et al book The Art of SEO, or any of the other books I’ve read, to develop my knowledge on SEO for the benefit of my clients and of course my pocket. J
Web Design | | JemRobinson0 -
301 redirects from old site to new
hey all, we just did a site redesign and have less pages on the new site than the old. is it bad to redirect multiple pages from the old site to the same page on the new? for example redirect ...com/apps ...com/android ...com/mobile and point them all to....com/custom-apps thanks!
Web Design | | jaychow0 -
Redirecting duplicate pages
For whatever reason, X-cart creates duplicates of our categories and articles so that we have URLs like this www.k9electronics.com/dog-training-collars
Web Design | | k9byron
www.k9electronics.com/dog-training-collars/ or http://www.k9electronics.com/articles/anti-bark-collar
http://www.k9electronics.com/articles/anti-bark-collar/ now our SEO guy says that we dont have to redirect these because google is "smart enough" to know they are the same, and that we should "leave it as-is". However, everything I have read online says that google sees this as dupe content and that we should redirect to one or the other / or no /, depending on which most of our internal links already point to, which is with a slash. What should we do? Redirect or leave it as is? Thanks!0 -
Wordpress drop down menu issue...
While I am tweaking my current site with getting rid of my footer links, my site will not allow a drop down menu for my service area parent page. It will do a drop down menu for any other tab. Could not find anything in a google search besides just link to parent for drop down... Any ideas?
Web Design | | greenjoe0 -
Optimal redirect configuration from a misspelled domain that we own.
We have a handful of inbound links to www.t-chek.com (note the hyphen). Our normal site is www.tchek.com (no hyphen). We own both domains and have some sort of domain-wide redirect set up now. This works fine for traffic, but I suspect it's not optimal for SEO purposes. I came to this conclusion by looking in OSE and noticing that none of the inbound links to www.t-chek.com were also being attributed to www.tchek.com. 2 questions: Is it immediately evident what type of redirect I have in place now, or do I need to figure that out? Is the fix as simple as editing the .htaccess file on the hyphenated domain? I don't have direct control over the hyphenated domain, and I'd like to be able to know exactly what we need to do so I can request help from my IT department. I'd appreciate hearing your wisdom. Thanks!
Web Design | | SheriGolla0