Results 1 to 5 of 5
Thread: help with a mod_rewrite rules
-
05-14-2005, 05:47 AM #1WHT Addict
- Join Date
- Oct 2001
- Location
- Mountain Home Arkansas
- Posts
- 131
help with a mod_rewrite rules
Howdy,
I have two questions:
1) I have this rule in .htaccess that works great for sending stuff back to my core scripts from a sub directory. However it kills any $_REQUEST vars I might want to use
Code:RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ https://mydomain.com/?var=$1
... for instance, redirect http://mydomain.com/page to http://mydomain.com/core/?page
I need to exclude 'core' from the mod-rewrite rules.
Any help will be much appreciated, I consider myself brighter than the adverate joe, but regex gives me a headacherocket science is more fun when you accually have rockets!
-
05-15-2005, 06:05 AM #2PHP for breakfast
- Join Date
- May 2004
- Location
- Lansing, MI, USA
- Posts
- 1,548
RewriteCond %{REQUEST_URI} !^/core/.*
RewriteRule ^([^.]+)$ https://mydomain.com/core/?var=$1 [L]
maybe?Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Over 5 Years Going Strong!
Website Hosting, PHP4&5, RoR, MySQL 5.0, Reseller Hosting, Development, and Designs
Powered By JAM - Professional Website Development - PHP, MySQL, JavaScript, AJAX - Projects Small & Large
-
05-15-2005, 08:52 AM #3WHT Addict
- Join Date
- Oct 2001
- Location
- Mountain Home Arkansas
- Posts
- 131
SHWEEEEEET! THANKS MAN!
here is what I ended up with
Code:RewriteEngine On RewriteCond %{REQUEST_URI} !^/core/.* RewriteRule ^([^.]+)$ index.php?page=$1
http://domain.com/core/
it rewrites it in the location bar to
http://domain.com/core/?page=core
It doesn't seem to hurt anything, it's just kinda weird
And I can just test the $_REQUEST['page'] var to lock people out from directly accessing the core.rocket science is more fun when you accually have rockets!
-
05-15-2005, 09:35 AM #4WHT Addict
- Join Date
- Oct 2001
- Location
- Mountain Home Arkansas
- Posts
- 131
ok, I fixed that minor URL bug by changing
RewriteCond %{REQUEST_URI} !^/core/.*
to
RewriteCond %{REQUEST_URI} !^/core.*rocket science is more fun when you accually have rockets!
-
05-15-2005, 02:32 PM #5PHP for breakfast
- Join Date
- May 2004
- Location
- Lansing, MI, USA
- Posts
- 1,548
Good. Glad to hear it's working for you
Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Over 5 Years Going Strong!
Website Hosting, PHP4&5, RoR, MySQL 5.0, Reseller Hosting, Development, and Designs
Powered By JAM - Professional Website Development - PHP, MySQL, JavaScript, AJAX - Projects Small & Large