When I set up my WP website, instead of installing it directly into public\_html I installed it in public\_html/my\_subdir. For this to work I made the following .htaccess

```
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/my_subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my_subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ my_subdir/index.php [L] 
</IfModule>

```

Then, I wanted to redirect [www.example.com](http://www.example.com) to [www.example.com/dev](http://www.example.com/dev) so I added a 301 redirect from Cpanel. The htaccess above created a redirect rule in Cpanel, and it was conflicting with my new redirect, so I erased the first one and my htaccess ended up as:

```
<IfModule mod_rewrite.c>
RewriteEngine on
</IfModule>
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "https\:\/\/www\.example\.com\/dev\/" [R=301,L]

```

It works, if I go to [www.example.com](http://www.example.com) it takes me to [www.example.com/dev](http://www.example.com/dev) but if I go to [www.example.com/services](http://www.example.com/services) it takes me to a Error 404 page.

How can I make it so going to any example.com page takes me to its equivalent in example.com/dev like `example.com/services = example.com/dev/services`