0

I have Wordpress installed in folder named wordpress

public_html
|
|wordpress
|
|webapp
|
|other folder
|junk folder

and traffic is forwarded to that directory on htaccess file like below.

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

If i want to access webapp folder i get redirected to wordpress. Is that because there is file index.php in the webapp folder?

I want to allow access to wordpress and webapp folders but not to other folders in public_html. How i can do that with htaccess?

Roger Wayne
  • 419
  • 3
  • 20
  • Your wordpress rules should be in a .htaccess file inside the word press folder. Where is this htaccess file located? – Panama Jack Jan 21 '17 at 22:22
  • Actually that same htaccess file is in both public_html and wordpress folders. If the file is removed from the public_html folder wordpress urls wont work anymore. – Roger Wayne Jan 22 '17 at 09:08
  • because you have it setup wrong. You need to remove it from the public_html folder first. And then edit your .htaccess file in wordpress folder and remove that webuser. It should only be `RewriteBase /wordpress/` and `RewriteRule . /wordpress/index.php [L]` – Panama Jack Jan 22 '17 at 13:21
  • But i want all traffic redirected to the wordpress directory by default when user are coming to www.owndomain.com and only www.owndomain.com/webapp is redirected to the webapp folder. – Roger Wayne Jan 22 '17 at 19:05
  • Now it is working there was wp-index.php in root folder now it is removed. Now www.domain.com is redirected to wordpress folder as i want but still want to rule to exclude that webapp folder so it can be accessed from www.domain.com/webapp. I used this htaccess in root folder https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory (Method I (Without URL change)). – Roger Wayne Jan 22 '17 at 19:57
  • Problem solved: http://stackoverflow.com/a/5136622/982646 – Roger Wayne Jan 22 '17 at 20:06
  • Ok I thought you just wanted a separate directory for wordpress and still serve everything else from the root because you had other folders in the root as well like other folder, junk folder. Wasnt clear on what you were asking. – Panama Jack Jan 23 '17 at 05:47

0 Answers0