473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

allow access to folders in spite of mod_rewrite

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 2864
Motoma
3,237 Expert 2GB
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
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: ...
2
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...
49
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...
3
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"...
2
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...
11
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...
29
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...
7
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.