Rewrite then normal files

Hi guys

Can I do this

www._________.com/chris/

What i am doing is then pulling all the details from database from the user chris

this works ok but when i do this

www._________.com/chris/myaccount.php

No page can be displayed, How can I set the variable then show all the files as normal

This post has no context, so it doesn’t make sense, luckily I read your other post so I know what you’re going for :smiley:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?([a-zA-Z0-9-]+)/(.*) files/$2?name=$1 [L]

Something like this? A request for example.com/chris/myaccount.php will be handled by the file files/myaccount.php (the single copy of this site/app), which can read the database name from $_GET[‘name’]

Haven’t actually tested that rule though…

And why does /chris/ work ? Did you already write some rule that worked for that but not for myaccount.php?

Thank you Dan

that is exactly what I needed however I am now having issue with a existing mod rewrite

How can i add that into my existing rewrite

RewriteRule ^([^/])/([^/])/([^/]*)/$ bookings.php?date=$1&event=$2&id=$3 [L]

wazo,

OMG! You are willing to send http://www.example.com//// to bookings.php with date, event and id containing nulls! You must have built a lot of smarts into bookings!

Okay, you REALLY need to show all your mod_rewrite code if you want others to troubleshoot. Better yet, I’d ask you to actually LEARN what you’re doing before attempting to use mod_rewrite code. Please start with the tutorial linked in my signature as it goes through from A-Z (server setup and test, regex to example codes). When you’ve done that, I will make sure that your code is correct and, more importantly, that you understand what your code is doing.

Regards,

DK