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
-
Anybody with a business site using Webflow CMS or another non-WordPress CMS/ sitebuilder?
If you have built your business site using Webflow CMS, kindly share your insights on how good their CMS is for SEO and how easy it is to rank a site. If you are not familiar with Webflow but have had a positive experience with another non-WordPress CMS/ sitebuilder, kindly share your opinions.
Web Design | | Blu_Ocean99.0 -
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 -
How to export Wordpress comments ONLY to a new domain
Hi Guys, We have a bit of situation here. We have a website (let's say it is www.oldsite.com) where we had more than 2000 posts. There arose a need whereby we had to move some 60-70 posts from this oldsite.com to another domain of ours (www.newsite.com). So, here is what we did: Move those 60-70 posts manually from oldsite.com to newsite.com Did a 301 redirect of each of those 60-70 posts from oldsite.com to newsite.com. Google has now started to rank the posts from the newsite.com for this. That's all good till now. Now, here comes the situation. We also want to move the comments from some of those posts of oldsite.com (some 10-12 posts out of those 60-70) to the respective posts of newsite.com. How do we do that? Do note that we are pretty comfortable with databases and to some extent PHP. Please help.
Web Design | | seocuppa0 -
Is it ok to redirect an old URL to new URL with anchor tag?
Ex. OLD URL - http://www.mysite.com/shoes/red/description NEW URL - http://www.mysite.com/shoes/red#desc Thanks in advance!
Web Design | | esiow20130 -
Creating Multiple Sub-Directories in Wordpress
Hi fellow Mozzers, I'm currently in the process of planning/building a website for e-commerce and have stumbled on a bit of a hurdle with sub-directories. I want to use a piece of software called SellerDeck to generate my e-commerce store and also my homepage (index.html). This element of the build is fine as the e-commerce store will sit in a sub-directory of .co.uk/store/. What I'm struggling with is the rest of the site architecture. I want to use Wordpress to manage content for the rest of the site. I want to have sub-directories .co.uk/help/ and .co.uk/blog/, all managed from one Wordpress installation. Is this possible? If not, does having two separate installations of Wordpress create any speed issues? Additional question for bonus points from me; lets say I wanted to do away with sub-directories for the /help/ and /blog/ elements (but keep the /store/), could I have a Wordpress installation that doesn't generate a homepage (index.php) so I can utilise the e-commerce software version instead. Essentially I'd be installing Wordpress at the root folder, but wouldn't have an index.php made by Wordpress. Many thanks in advance
Web Design | | BlueTree_Sean0 -
Wich wordpress pinterest theme is your favourite
Wich wordpress pinterest theme is your favourite I am looking for one more new, modern and responsive to replace the one i have on this web sonrisas
Web Design | | maestrosonrisas0 -
My site build in HTML has been badly hit this recent update and I have been toying on the idea of changing it to Wordpress
My site build in HTML has been badly hit this recent update and I have been toying on the idea of changing it to Wordpress. Would this help in my rankings? It seems the hit came only that last 2-4 days when business become much quieter. Frankly i have no idea on why the site fell in ranking all of a sudden. Been comparing to competitors and even a friend in the same industry and nothing makes sense so far (link profile, DA, PA etc) This site has been ranking well for 3 years prior to this. 2. My site has loads of content and visitors arrive from various landpages. But by changing it wordpress, the url of most of them would probably change. What should i do? 301 redirect all of them or is there a better method?
Web Design | | rester0 -
301 Redirect ! Joomla Pages, Already ranking. ( just wanted to change the url
hey guys hope everyone had a new year. I am ranking for a page on my site that i want to ( not specifically move ), but just change the url name: It is too long i think and i want to move it from one portion of my architecture to another menu. I have never physically done a 301 redirect myself, always had someone do it for me. I wanted some pointers. Since it is a fairly new site 4 months old! What are my options. Do i need to 301 redirect the page, if i am changing the Structure and AI of my site, or can i just change the url as is and it will still get ranked? How do i keep that url put delete the page and redirect it ? Sorry its very simple but i wanted to get the communities help to continue on ! Best Wishes HAmpig
Web Design | | BizDetox0