0

I am trying to create folder on my site which is named demo

so www.mysite.com/demo/afile.html

but i want it so it looks like demo.mysite.com/afile.html

i have edited the htaccess file that was already created by 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]


RewriteCond %{HTTP_HOST} ^demo\.mysite\.com$
RewriteCond %{REQUEST_URI} !^/demo/
RewriteRule (.*) /demo/$1

</IfModule>

# END WordPress

But when i go to demo.mysite.com/afile.html its not found. What am i doing wrong

1 Answer 1

1

I think you have to create the subdomain demo.mysite.com that point to a folder with a .htaccess on it.

But in this case, you just have to choose the directory containing your demo site /path/to/mysite/demo as the DocumentRoot for the subdomain demo.mysite.com (and no need for rewrite rules)

Sign up to request clarification or add additional context in comments.

1 Comment

im still a little confused, so do i not need too add htaccess with a sub domain?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.