views:

15

answers:

1

pre_config_step_2.php?type=Grocery&count=2

to

/pre_config_step_2/Grocery/2

do i need to change the htaccess in the root directory and if so what do i change it to

+1  A: 
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule   ^pre_config_step_2/(\w+)/(\d+)$ pre_config_step_2.php?type=$1&count=$2
</IfModule>

That would consider accessing /pre_config_step_2/Grocery/2 as if requesting pre_config_step_2.php?type=Grocery&count=2.

aularon
here is the linkhttp://posnation.com/pre_config/pre_config_step_2/Grocery/1and its not working
Matt
Where did you put the .htaccess file? Also, are you sure you have a working mod_rewrite support? (To check, change `RewriteEngine` into `RewriteEngineBlabla` and see if it issues a `500 internal server error`)
aularon
Matt
the `.htaccess` file should be in the `public_html/pre_config/` folder, not the `public_html/` root. Try with that.
aularon
ok so the file is now in the right place and i changed it to RewriteEngineBlabla and look at the link now....but when i change it back to the way i originally had it nothinghttp://posnation.com/pre_config/pre_config_step_2/Grocery/2
Matt
That's weird, I just tested it locally and it worked!
aularon
Try adding `RewriteBase /pre_config` line after `RewriteEngine On`.
aularon
Matt
but now my stylesheets are all off
Matt
Sure, cuz they have relative path, and that is broken due to the new `/` slashes in the url, you need to fix your css references to be absolute , i.e. start with a `/` (server root). I guess we are done with the `.htaccess` `mod_rewrite` question, right? :)
aularon
yes thanks for all your help on that...so the css path should be absolute...what do you mean by new / slashes in the url,
Matt
I suggest asking a new question, it's more structured and will help other people looking for the same info. Put a new question about relative and absolute urls and how relative paths break on url rewriting.
aularon