473,761 Members | 3,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

allow access to folders in spite of mod_rewrite

14 New Member
Hi,

I'm currently using mod_rewrite to rewrite URLs with server variables.

Expand|Select|Wrap|Line Numbers
  1.     RewriteEngine on
  2.  
  3.         RewriteRule ^([A-Za-z0-9-_]+)$ /layout4/$1/ [R]
  4.             RewriteRule ^([A-Za-z0-9-_]+)/?$ index.php?dir=&page=$1
  5.         RewriteRule ^([A-Za-z0-9-_/]+)/([A-Za-z0-9-_]+)$ /layout4/$1/$2/ [R]
  6.             RewriteRule ^([A-Za-z0-9-_/]+)/([A-Za-z0-9-_]+)/?$ index.php?dir=$1&page=$2
where $dir is the directory path and $page is the filename

What I'd like to do is somehow enable visitors to actually open a folder. ie. I have a folder http://localhost/layout4/discography, but when I type that in, mod_rewrite thinks that its a query of a sort and doesn't lead to the folder discography or rather, discography/index.php. What should I do? Or is the better way to simply not use index.php and redirect http://localhost/layout4/discography to something like http://localhost/layout4/discography/main.php?

Thanks y'all! :D
Jun 3 '07 #1
1 2877
Motoma
3,237 Recognized Expert Specialist
The safest way to do this would be to create a script to show your user the directory.
That way discography/ would really be discography/index.php, but the user would not know the difference.
Jun 6 '07 #2

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

Similar topics

1
2279
by: Westcoast Sheri | last post by:
Hello. How do I do this: If a visitor types in any number after my url, I want mod_rewrite to convert it to my url/anotherpage.html?number=number_visitor_typed Example: http://www.mysite.com/12345678.html would result in:
2
3939
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company 1&1 with only limited server configuration via a web based control panel. My query relates to the ASP security model and how it relates to FrontPage options for setting file access on a database file. If you know of any online documentation...
49
14352
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The application is relatively big: around 200 tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data (SQL Server 2000), 40 users. I'm wondering what are the disadvantages of using Access as front-end? Other that it's not...
3
3780
by: Ryan | last post by:
How can I set the write permissions for a certian folder within a virtual directory using the web.config file? Essentially, I want to give the ASP.NET user write permissions to the "uploads" folder so I can upload files to my site. Thanx
2
1157
by: mjpmsa | last post by:
What permissions are necssary to allow developers to open an ASP.Net project so that they can compile it through Visual Studio? They can do this fine on their local machines, but not on a somewhat locked down server that they are accessing through shares. I'm investigating what would be necessary to open this up to them. Hopefully it doesn't require Front Page extensions or Web Dav. Alternatively, are there any utilities like make...
11
2080
by: joelbyrd | last post by:
I have a people-networking type site in which each user has their own profile page, with their user id encoded. So, for example, the web address of their page might look like "www.example.com/my_profile.php?user_id=fdjkhfh2489298hf298h3s0dhfxj". I want the users to be able to choose their own web address that would look like "www.example.com/Joel", and then when they type in that address, they are automatically redirected to their profile...
29
3464
by: Paul H | last post by:
Why the heck was this dropped? All my dbs use ULS even the complex ones. It aint perfect, it's too fiddly, but it works. How will I be able to say "These users can run these reports and these users can't." in Access 2007? Will I have to create my own tables (tblSecurityGroups, tblSecurityUsers) and code the whole thing? Thanks, Paul
7
1740
by: Dale | last post by:
again, i know this is OT...just move along to the next post if it bugs you. :) i had been trying to have this: project.66.204.32.110 from the client browser, map to a virtual host where the document root would be:
3
2824
by: V S Rawat | last post by:
I have to work on a website (in php). I downloaded index.php and when I loaded it through my wamp localhost php installation, it gave some errors mentioning the file names, from includes\ so I downloaded them. now it is just saying "No configuration file found and no installation code available. Exiting..." It is not even telling the filenames it needs to run that site offline.
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
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 we have to send another system
3
3509
muto222
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.