SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast elchenuk's Avatar
    Join Date
    Aug 2005
    Location
    Manchester, UK
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can I use mod rewrite for my new website?

    Hi bit of a newbie question.

    I have been developing a wordpress site on a test domain for example testdomain.stagingserver.com/mysite. I now want to point my real domain for example www.mysite.com to this site which is straightfoward enough to do. But what do I do about the URLs, images etc that have the test domain within the code?

    Is this where mod rewrite comes in helpful?

    thanks in advance

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,081
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    No the function of mod_rewrite is to take an incoming URL and rewrite it to another URL to use internally, and it only works on URLs; it will not rewrite code. I'm afraid what you need to do is actually rewrite your code to point to the correct locations, which should be easy enough with a search/replace.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    el,

    As Rémon pointed out, you have a misconception about what mod_rewrite so I'll first advise you to read the long tutorial article linked in my signature.

    Then, because of the way WP works, I'd advise you to move the installation to the DocumentRoot of your website and adjust the config files to reflect the new locations. Twisting WP around with mod_rewrite (then expecting WP's mod_rewrite to work) is a hit-and-miss (mostly MISS) situation.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •