470,863 Members | 1,374 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

Hide Subdirectory name in URL

ryno du preez
I 'm trying to hide my sub directory with in the URl
exp wwww.exsample.com/directory/index.php I want to display it as www.exsample.com/index.php
Below is the Htaccess script I'm using but it causes my site to break
Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks -MultiViews
  2. # Turn mod_rewrite on
  3. RewriteEngine On
  4. RewriteBase /
  6. RewriteCond %{REQUEST_FILENAME}.php -f
  7. RewriteCond %{REQUEST_URI} !/$
  8. RewriteRule (.*) $1\.php [L]
  10. RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+dirname/([^\s]+) [NC]
  11. RewriteRule ^ %1 [R=301,L]
  13. RewriteCond %{REQUEST_FILENAME} !-f
  14. RewriteRule (?!^dirname/)^(.*)$ /dirname/$1 [L,NC]
While my site is loaded in to Chase the script works very well but when I reload the page the site does not load correctly.

Any advice will be creat
May 21 '15 #1
4 5143
8,656 Expert Mod 8TB
THE_REQUEST is not a valid rewrite condition target.
May 22 '15 #2
Thank you for your reply What must I use
May 22 '15 #3
8,656 Expert Mod 8TB
What must I use
RewriteRule, not RewriteCond.
May 22 '15 #4
thank you I'll Try that
May 22 '15 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by HWG | last post: by
1 post views Thread by asianet | last post: by
2 posts views Thread by Jurjen de Groot | last post: by
5 posts views Thread by kamill | last post: by
14 posts views Thread by tuananh87vn | last post: by
7 posts views Thread by Fred | last post: by
1 post views Thread by Deepak thakur | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.