Can I rewrite a static URL to a different static URL?

6 replies
I had a wordpress site up with permalinks that ended in a directory style (ie. "domain.com/category/post/") but no matter what theme I had up wordpress would spit out 2 different versions of each post, one with the correct title, and one with a different title. You wouldnt be able to see 2 versions of each post in the admin section, you would just see the one and everything looked fine. But Google would cache 2 different posts which were similar except for the titles and some strange in-line css styling applied on the one with the good title. The one with the incorrect title was the one that was moving up in the seach engines and because it was duplicate content it was also not ranking as well as it should have been. So I just gave wordpress the bird and put up an html site. Does anyone know if and how I can change html urls (ie. "domain.com/page.html") to a directory style (ie. "domain.com/page/") so I dont lose all the links I had already built to the old wordpress posts? Thanks
#rewrite #static #url #wordpress
  • Profile picture of the author SteveJohnson
    #1, WordPress doesn't do what you're describing by itself. 'Giving WordPress the bird' was kind of premature. The problem was a plugin that you were running.

    To answer your question, though, yes, you can change the .html URLs by using rewrite directives in your htaccess file. If you're wanting to use directory/folder names in the URLs, it could get a little complicated.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[5198774].message }}
  • Profile picture of the author casius
    Well, what I could recommend by the most easiest way is to use websitetest.org and run this test on the different links and you will see where you will have the problem instead of chasing the problem inside your WP without knowing where to look for the problem. Alternatively PM me and I would be more than happy to help you on this.
    Signature
    Cloud VPS || Shared Hosting
    Web Hosting Solutions for Geeks!
    HOST1PLUS
    {{ DiscussionBoard.errors[5200869].message }}
  • Profile picture of the author RobKonrad
    Where did the wrong title come from?

    You can use 301 redirects in WP, there are some plugins for that...

    WordPress › Redirection « WordPress Plugins

    just a sample...

    Cheers,
    Rob
    Signature
    ================================================== ===
    This blog is awesome: http://www.robkonrad.com/blog. Read it.
    ================================================== ===
    {{ DiscussionBoard.errors[5201686].message }}
  • Profile picture of the author msam029
    i dont think wordpress do it as u are telling .

    perma links wil @ a time allow only one url for a post .
    are u using any plugin


    Originally Posted by avjoseph View Post

    I had a wordpress site up with permalinks that ended in a directory style (ie. "domain.com/category/post/") but no matter what theme I had up wordpress would spit out 2 different versions of each post, one with the correct title, and one with a different title. You wouldnt be able to see 2 versions of each post in the admin section, you would just see the one and everything looked fine. But Google would cache 2 different posts which were similar except for the titles and some strange in-line css styling applied on the one with the good title. The one with the incorrect title was the one that was moving up in the seach engines and because it was duplicate content it was also not ranking as well as it should have been. So I just gave wordpress the bird and put up an html site. Does anyone know if and how I can change html urls (ie. "domain.com/page.html") to a directory style (ie. "domain.com/page/") so I dont lose all the links I had already built to the old wordpress posts? Thanks
    {{ DiscussionBoard.errors[5201915].message }}
  • Profile picture of the author GilGarcia
    You can do it in HTML

    Google for .htaccess mod_rewrite

    You'll be able to "remove" .html extension from the files.
    Signature
    {{ DiscussionBoard.errors[5202809].message }}
  • Profile picture of the author kokopelli
    Does anyone know if and how I can change html urls (ie. "domain.com/page.html") to a directory style (ie. "domain.com/page/") so I dont lose all the links I had already built to the old wordpress posts?
    You can do it with htaccess, or create sub-folders, each with a index.html or index.php. So, in your example, just create a subfolder "page" and an index file for it, and upload.
    Signature
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {{ DiscussionBoard.errors[5232230].message }}

Trending Topics