472,977 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,977 software developers and data experts.

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 5985
Dormilich
8,658 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,658 Expert Mod 8TB
What must I use
RewriteRule, not RewriteCond.
May 22 '15 #4
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.