473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Hide Subdirectory name in URL

ryno du preez
91 New Member
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 6308
Dormilich
8,658 Recognized Expert Moderator Expert
THE_REQUEST is not a valid rewrite condition target.
May 22 '15 #2
ryno du preez
91 New Member
Thank you for your reply What must I use
May 22 '15 #3
Dormilich
8,658 Recognized Expert Moderator Expert
What must I use
RewriteRule, not RewriteCond.
May 22 '15 #4
ryno du preez
91 New Member
thank you I'll Try that
May 22 '15 #5

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

Similar topics

2
by: HWG | last post by:
Hi All, In sqlplus, what set option is used to show/hide the column name from the sql return? e.g. select * from dual; X
1
by: asianet | last post by:
I have to make a servlet for controlling all other servlets. The browser should show only one url. eg: http://www.ourdomain.com/ControllerServlet what I have to do for this? please advice me......
2
by: Jurjen de Groot | last post by:
Hello, Is there someway to hide the name of the page in the browser? When a page is display the full address is shown like http:\\www.mysite.com\Default.aspx, is there some setting (maybe in IIS...
0
by: jjalexrayer | last post by:
How do hide page name in address bar? This is my task. every programmer displaying every page name on Address bar. for example C://inetpub/wwwroot/project1/sample.aspx . instead of this url i...
5
kamill
by: kamill | last post by:
I need to hide name of web pages from URL, I need to show only domain name of web site, and want to hide the name of web pages after slash. Example insteade of www.mysiteabc.com/anyfile.php, i...
0
by: Asad Asad | last post by:
How can I hide a process name in Taskmanager,in Visual Basic 6.0? I can hide/unhide a application(which is running) name in taskmanager by using following code: Private Sub Command1_Click()...
14
by: tuananh87vn | last post by:
hi, I see that it's easy to create a navigation like index.php?id=1, index.php?id=2... then you can hide the current part you are in. But I need a further step (as I've seen many), hope it's easy...
7
by: Fred | last post by:
I have a file (access.php) with the db username and pwd, which I include in every php file that needs db access. I'm not clear on how to set the path. I have an account on a shared *nix server,...
1
by: Deepak thakur | last post by:
Hello to every one , i want to hide file name from the url. Please reply Thanks. Deepak
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.