0

I create a subdomain called services and I want to redirect it to a folder, but I can't make it work.

I tried this:

# 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 RewriteCond %{HTTP_HOST} ^services\.\.com.br$ RewriteRule ^/$ http://subdomain.mydomaintest/services/ [R,L] 

The path to the folder is mydomain/web/services

1 Answer 1

1

This should work for you :

# subdomain to subfolder RewriteEngine on RewriteCond %{HTTP_HOST} ^services\.com.br$ RewriteRule !service /services%{REQUEST_URI} [L] # 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 
Sign up to request clarification or add additional context in comments.

3 Comments

Does it take a time to work or it should work instantly? I'm asking because I tried to use your code but it's not working, the browser is returning "Hmmm… can't reach this page" :'(
@Lucky It should work instantly. What URL are you going to?
I'm getting a " Hmmm… can't reach this page" and DNS_PROBE_FINISHED_NXDOMAIN"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.