• Hi Friends,
    I have a domain (https://www.example.com) which not a wordpress website. But all my subdomains ( https://blog.example.com ) are wordpress sites.

    How I can redirect this subdomain URL to directory URL (including wp-admin)?

    https://blog.example.com -> https://www.example.com/blog/

    What is the .htaccess rules I need to add ?
    Should I change WordPress Address (URL) and Site Address (URL) in the settings -> general page ? If yes how it looks like?

    Please help me. Thanks in advance

    • This topic was modified 9 years, 7 months ago by riyazmuhammad.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    You may find this information helpful: https://www.a2hosting.com/kb/developer-corner/apache-web-server/using-htaccess-files

    In most of wordpress blog .htaccess file resides by default in the root of wordpress installation. Simply look for hidden files on your root directory and you should be able to find .htaccess.

    Additional information regard your question about redirect.

    There are various ways to do do redirects-

    301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis

    # This allows you to redirect your entire website to any other domain
    Redirect 301 / http://example.com/

    In your case, you can use something like this-

    RewriteEngine On
    RewriteRule / http://new-domain.com/$1? [R=301]
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Subdomain to directory proper redirection’ is closed to new replies.