Title: htaccess redirect &#8211; wordpress code conflict
Last modified: August 20, 2016

---

# htaccess redirect – wordpress code conflict

 *  [isshepherdmusic](https://wordpress.org/support/users/isshepherdmusic/)
 * (@isshepherdmusic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/htaccess-redirect-wordpress-code-conflict/)
 * Hi, I wonder if some kind soul can help me.
 * I have built a new WordPress site in a sub directory called ‘wp’. Rather than
   moving everything (which I don’t fully understand how to do) Id like to simply
   redirect the main page i.e. [http://www.example.com](http://www.example.com) 
   to point to [http://www.example.com/wp/](http://www.example.com/wp/) and for 
   all pages to load from within that sub directory minues the /wp/ in the address
   line.
 * As per instruction from my web host I have added this redirect code to the .htacess
   file:
 * # Justhost.com
    # .htaccess main domain to subdirectory redirect # Copy and paste
   the following code into the .htaccess file # in the public_html folder of your
   hosting account # make the changes to the file according to the instructions.#
   Do not change this line. RewriteEngine on # Change example.com to be your main
   domain. RewriteCond %{HTTP_HOST} ^(www.)?example.com $ # Change ‘subdirectory’
   to be the directory you will use for your main domain. RewriteCond %{REQUEST_URI}!
   ^/wp/ # Don’t change these line. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond%{
   REQUEST_FILENAME} !-d # Change ‘subdirectory’ to be the directory you will use
   for your main domain. RewriteRule ^(.*)$ /wp/$1 # Change example.com to be your
   main domain again. # Change ‘subdirectory’ to be the directory you will use for
   your main domain # followed by / then the main file for your site, index.php,
   index.html, etc. RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteRule ^(/)?
   $ wp/index.php [L]
 * However this is not working and my web host, who are not being very helpful, 
   tell me that some existing code generated by WordPress is conflicting. This is
   the existing code in the .htaccess file:
 * DirectoryIndex index.html index.shtml index.xhtml index.wml index.perl index.
   pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.
   php3 index.php index.phtml index.htm home.htm default.htm index.fcgi default.
   html
    # -FrontPage-
 * IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
 * <Limit GET POST>
    order deny,allow deny from all allow from all </Limit> <Limit
   PUT DELETE> order deny,allow deny from all </Limit> AuthName zsr-art.org.uk AuthUserFile/
   home/zsrarto1/public_html/_vti_pvt/service.pwd AuthGroupFile /home/zsrarto1/public_html/
   _vti_pvt/service.grp
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /index.
   php/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond%{
   REQUEST_FILENAME} !-d RewriteRule . /index.php/index.php [L] </IfModule>
 * Im using permalinks, I wonder whether this is causing a problem. Could someone
   please advise me as to where the conflict is and how to fix it?
 * Thanks
    Ben

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/htaccess-redirect-wordpress-code-conflict/#post-2898615)
 * You need to do this:
 * [http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install](http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install)
 * What your host has you doing is kind-of odd, frankly. The above is the right 
   way to do it.
 *  Thread Starter [isshepherdmusic](https://wordpress.org/support/users/isshepherdmusic/)
 * (@isshepherdmusic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/htaccess-redirect-wordpress-code-conflict/#post-2898647)
 * Brilliant, this worked. Thank you so much for your time.
 * Kind Regards
    Ben

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘htaccess redirect – wordpress code conflict’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [Sub-directory](https://wordpress.org/support/topic-tag/sub-directory/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [isshepherdmusic](https://wordpress.org/support/users/isshepherdmusic/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/htaccess-redirect-wordpress-code-conflict/#post-2898647)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
