Wildcard subdomains have been set up but it's giving off error 404 (2 posts)

  1. ixaraan
    Posted 4 years ago #

    I've set up the DNS entry

    *.reviews.softpip.com. 14400 IN A

    and added the subdomain in cPanel as such:


    .htaccess (in /public_html/reviews/) contents:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^([a-z0-9][a-z0-9_\-]*[a-z0-9])\.reviews\.softpip\.com$ [NC]
    RewriteRule ^(.*)$ index.php?pagename=%1 [L,QSA]

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymLinks
    Options +Indexes
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    What I've tried to to is (silently, without changing the displayed URL) rewrite SUBDOMAIN.reviews.softpip.com to reviews.softpip.com/index.php?pagename=SUBDOMAIN (as using permalinks has failed since they're not real directories)

    However, it's just giving off a 404 error.

    I've added this to the footer of the theme, to check:

    <!-- <?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . "?" . http_build_query($_GET); ?> -->

    The output is "hello-world.reviews.softpip.com/?pagename=hello-world".

    Going to http://testing.reviews.softpip.com/index.php works fine with my rewrite cote in the .htaccess file removed (meaning it just rewrites to the main page)

    Where did I mess up?

  2. ixaraan
    Posted 4 years ago #

    Here's the HTTP request:
    [06:19:21.293] GET http://testing.reviews.softpip.com/ [HTTP/1.1 404 Not Found 1266ms]

Topic Closed

This topic has been closed to new replies.

About this Topic