468,512 Members | 1,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 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 /
  5.  
  6. RewriteCond %{REQUEST_FILENAME}.php -f
  7. RewriteCond %{REQUEST_URI} !/$
  8. RewriteRule (.*) $1\.php [L]
  9.  
  10. RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+dirname/([^\s]+) [NC]
  11. RewriteRule ^ %1 [R=301,L]
  12.  
  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 4805
Dormilich
8,651 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
Dormilich
8,651 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
kamill
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
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.