Home Use .htaccess to rewrite address from xxx.site.com to site.com/xxx/
Reply: 0

Use .htaccess to rewrite address from xxx.site.com to site.com/xxx/

user1349
1#
user1349 Published in June 19, 2018, 6:25 pm

I'm "limited" in my "create your own code" kinda way (problem with my work memory (no not the computer), that makes me lose the thread when programming, well, this isn't Dr Phil..(ops, wrong kind of doctor) Let's get the case.. ).

I'm looking for a way for users to access their page by typing xxx.site.com and are then forwarded to their respective WordPress post.

Now I already have two rewrite functions on my site: (not written by me)

To use https everywhere:

 #Rewrite everything to https
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]

And the WordPress:

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

# END WordPress

Now, that WordPress function seems to translate site.com/post_title to the corresponding post.

.. But how do I rewrite it so it translates post_title.site.com to the corresponding post?

.. And if possible, still show the xxx.site.com instead of site.com/xxx

Can anybody please help me?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.32207 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO