Jump to content

Virtual Folder Problem (Slash is missing, *cough* It's a virtual file now!)


MPeter

Recommended Posts

Dear PHP Freaks,

 

here my running code which does fine for now:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([^/]+)$ index.php?q=$1 [QSA]

 

But it is ment to be a virtual folder instead of what it does to be a virtual file!

 

Second, it has a problem that it does submit q= two times when you look at the $_SERVER['QUERY_STRING'] - e. g.:

QUERY_STRING:
q=index.php&q=Y-m-d

And I do not get it why.

 

Still, debugging it shows that the code does run fine:

root@ubuntu:/tmp# more rewrite.log
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/index.php -> index.php
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (3) [perdir /var/www/] applying pattern '^([^/]+)$' to uri 'index.php'
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (2) [perdir /var/www/] rewrite 'index.php' -> 'index.php?q=index.php'
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (3) split uri=index.php?q=index.php -> uri=index.php, args=q=index.php&q=100
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (3) [perdir /var/www/] add per-dir prefix: index.php -> /var/www/index.php
127.0.0.1 - - [28/Oct/2010:19:16:56 --0700] [localhost/sid#218d7c58][rid#21a95400/initial] (1) [perdir /var/www/] initial URL equal rewritten URL: /var/www/index.php [iGNORING REWRITE]

 

As you see this coding above badly needs optimiziation. I hope I did describe the two problems to the best as possible, and that you can help me out without pointing me into cheatseets or the official httpd site. I got a few through already, and that is the result of them - *smile*

 

Big thank you.

 

Regards,

 

MPeter

(New PHP Freak User)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.