473,395 Members | 1,454 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,395 software developers and data experts.

Htaccess problem

Hi group,

I have the htaccess code that is below to redirect everything to
index.php exept for the mentioned folders. (img, swf, js and css)
Now when i try to access domain.com/testfolder/img
in Firefox i get redirected to domain.com/testfolder/img/?img
How can i prevent this?

And i was wondering if i could 'tell' the htaccess to use the folder
it's in as root automatically.
And somehow my values don't get passed to index.php. That doesn't make
sense to me either ...

# S T A R T H T A C C E S S # # # # # # # # # # # # # # # #

RewriteEngine On

RewriteBase /testfolder/
RewriteRule ^((img|swf|js|css)(/.*)?){1}?$ - [PT]
RewriteRule ^(.*)$ index\.php?$1 [L]

# E N D H T A C C E S S # # # # # # # # # # # # # # # # # #

Frizzle.

May 27 '06 #1
4 1832
What i forgot to mention is that the excluded folders actually exist,
the rest of them are fake.

Frizzle.

May 27 '06 #2
frizzle wrote:
Hi group,

I have the htaccess code that is below to redirect everything to
index.php exept for the mentioned folders. (img, swf, js and css)
Now when i try to access domain.com/testfolder/img
in Firefox i get redirected to domain.com/testfolder/img/?img
How can i prevent this?

And i was wondering if i could 'tell' the htaccess to use the folder
it's in as root automatically.
And somehow my values don't get passed to index.php. That doesn't make
sense to me either ...

# S T A R T H T A C C E S S # # # # # # # # # # # # # # # #

RewriteEngine On

RewriteBase /testfolder/
RewriteRule ^((img|swf|js|css)(/.*)?){1}?$ - [PT]
RewriteRule ^(.*)$ index\.php?$1 [L]

# E N D H T A C C E S S # # # # # # # # # # # # # # # # # #

Frizzle.


I would suggest asking this in alt.apache.configuration.
May 27 '06 #3
Rik
frizzle wrote:
# S T A R T H T A C C E S S # # # # # # # # # # # # # # # #

RewriteEngine On

RewriteBase /testfolder/
RewriteRule ^((img|swf|js|css)(/.*)?){1}?$ - [PT] ------------------------------------------^

What's the questionmark doing there?
Or the 'silly' {1} for that matter? (This is always implied, (#[.#]} is only
needed when match isn't:
- 1 (which it will assume if nothing is given).
- 0 or 1 (the ?)
- 0 or more (*)
- 1 or more (+)
I've never use PassThrough, but to me it seems it should be:
RewriteRule ^(img|swf|js|css)/.*$ - [PT]

RewriteRule ^(.*)$ index\.php?$1 [L]


---------------------------------^

This dot doesn't need to be escaped

As stated in another post, this isn't PHP, post in an apache ng.

Grtz,
--
Rik Wasmus
May 27 '06 #4
Rik wrote:
frizzle wrote:
# S T A R T H T A C C E S S # # # # # # # # # # # # # # # #

RewriteEngine On

RewriteBase /testfolder/
RewriteRule ^((img|swf|js|css)(/.*)?){1}?$ - [PT]

------------------------------------------^

What's the questionmark doing there?
Or the 'silly' {1} for that matter? (This is always implied, (#[.#]} is only
needed when match isn't:
- 1 (which it will assume if nothing is given).
- 0 or 1 (the ?)
- 0 or more (*)
- 1 or more (+)
I've never use PassThrough, but to me it seems it should be:
RewriteRule ^(img|swf|js|css)/.*$ - [PT]

RewriteRule ^(.*)$ index\.php?$1 [L]


---------------------------------^

This dot doesn't need to be escaped

As stated in another post, this isn't PHP, post in an apache ng.

Grtz,
--
Rik Wasmus


Thank you both for pointing this out to me!
I reposted the message (slightly modified thanks to Rik) on
alt.apache.configuration
under
http://groups.google.com/group/alt.a...30661280f74a29

Frizzle.

May 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: yawnmoth | last post by:
i'm trying to write a php script that will password protect some random directory by creating a .htaccess file, and a password file to accompany the .htaccess file, and it isn't working... ...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
13
by: Bob Bedford | last post by:
I've protected a directory with an .htaccess file. I'd like some of the files in this directory to be accessible by a scheduler that runs an "URL". The problem is that the scheduler runs scripts...
3
by: Adam King | last post by:
Hey, I've done the standard old trick of adding the error page line into ..htaccess which works absolutely fine if I accidently go to any file other than .php But if I go to "doesntexist.php" I...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
0
by: Jörg Braun | last post by:
Hello NG, i have a problem With WebRequest! i want to download a htaccess saved file over a proxyconnetion with authentication. Download a file what is not saved with htaccess is no problem,...
1
by: John MacLeod | last post by:
I'm having a problem using the .htaccess file to point my local installation of php5 (located at www.mydomain.com/horde/cgi-bin/php5.cgi). As per the instructions I was following I added the...
5
by: Nosferatum | last post by:
I am in need of a solution on how to solve this problem: I need to limit access to six different folders. My users are validated in a system which check their prescence with a couple of...
0
by: asherwolf | last post by:
Hi, I'm trying to do something I think is pretty neat, but I've just about pulled my hair out by the behavior of my server. I'm hosting on GoDaddy, using a subdomain (www.mywebpage.com maps to...
0
by: deco12 | last post by:
Hi, I am new to web design and Apache, but have managed to password protect my site by putting a .htaccess file in the sites root directory. I have set it up so that a number of members have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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:
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...

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.