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
-
Wordpress Tag Organization Tips
Curious if anyone has some good examples of ways to organize your WordPress tags without making your sidebar a football field long and hard to navigate. My blog is https://karmahill.com/blog and I could use some ideas. We have main categories of photo shoot types, for example, "Couples", located on the sidebar. We want to add tags to go with those main categories for further categorization and user experience example: Couples Engagement Proposals Honeymoon Maternity My question is, do I need to make "tag" pages for those posts to reside on or is their another way to get it done with less work, that is much faster? I don't want to have to make 30 tag pages or is that just what you have to do?
Web Design | | photoseo13 -
How long should an old site redirecting to a new site remain activated on a server?
Once I switch a site to a new domain (with links to corresponding/relative pages), will I have to keep the old site live forever for those links to work, or how long should I wait before I inactivate the old site on our server?
Web Design | | jwanner0 -
Wordpress shortcode or plugin for current time
In the footer of my WP site at http://www.strikemodels.com/, I have "Questions? Call us at xxx-xxx-xxxx 10:00 am to 8:00 pm Pacific time or email [address]" I've searched, but haven't easily found a shortcode where I can insert the current time for my time zone in this footer statement. Does anyone know if such a thing exists? The Do Not Disturb function on the iPhone has been a big help, but we've still had calls at three in the morning from someone in Australia on New Year's Day who didn't know how to look up time differences online.
Web Design | | KeriMorgret0 -
4XX (Client Error) on Wordpress Wesbite
I've just taken over the management of a website and am getting 4x 4XX (client Error) issues. Example: http://inter-italia.com/en/wp-login.php?action=lostpassword Can anyone give any guidance as how to fix this wordpress? I also see a lot of 'temporary redirects' due to multilingual plugin - is there anything I can do to fix this?
Web Design | | skehoe0 -
Wordpress or Joomla?
I'm very interested on what users here use and why? From my experience regarding online SEO, both CMSs are equal. However, the ease of use is a different story. While both systems have a learning curve, wordpress is the easiest to learn thus making it probably the most popular CMS today. Joomla on the other hand takes a bit more time to understand but when learned, can be quite flexible. So if anyone here is kind enough to add their thoughts, I'm all ears!
Web Design | | kumidiaweb0 -
Responsive Web Design WordPress Template Suggestions
Does anyone have any RWD WP templates they would suggest? It's for a friend of mine that is starting a local solar panel installation company. For the beginning, he likely will not have more than a handful of categories and subcategories. I'd say no more than 50 total pages. Any suggestions would help. He doesn't want to spend more than $50 - $100, but he's not married to that figure if it's worth it. Thanks everyone, Ruben
Web Design | | KempRugeLawGroup0 -
Hey, So I know wordpress is built with a user capability, but what about databasing custom user data?
Hi everyone, so I am working on a project with a friend of mine, without getting into too much detail, here's the problem. We need users to sign in, then for instance, click a button, and then have that action record a value of 1 in a database on our server (preferably accessible through the wordpress admin interface, and in .csv format so that we can make it easy to work with) Any help with databasing, or if wordpress is already built with SOME database technology, etc, etc For instance, SEOmoz's "mozpoint" system.. Wordpress comes built with the ability for users to log in and have profiles with special access, etc, but does it have the ability to log points and values to a specific user as well? Where should I look? What should I google to figure out options? Who could I call / hire?
Web Design | | TylerAbernethy0 -
Redirecting 301 Redirects -- Will Search Engines Notice?
Hello Mozzers, We're currently evaluating a client site where the previous web developer redesigned the site and got lazy, 301 redirecting hundreds of pages to the home page instead of to their respective new URLs. Ugh. In any case, we will probably fix this for the sake of implementing best practices. But I am curious how search engines treat 301'd URLs, as they are supposed to be permanent redirects. Will search crawlers ever visit the old URLs again to find that we've re-redirected them? Or have they written them off as moved to the home page for good, meaning that there's no way to direct the authority of the previous URLs to their rightful targets? Thanks!
Web Design | | SEOTeamSF0