Need help with mod rewrite.
my site is set up like:
http://www.mysite.com/search/exsearch.php <------home page
I need to some how write this as the index.html page
next
I have : http://mysite.com/search/exsearch.php?advanced=1
I would like for it to be http://mysite.com/search/directory.html or something simiilar
last my categories are like:
http://www.mysite.com/search/exsearch.php?dir=candles <--- name of category
I got it part way working.
If I use this in my .htaceess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} /search/
RewriteRule search/(.*).html /search/exsearch.php\?dir=$1 [L]
RewriteCond %{REQUEST_URI} /dir/
RewriteRule dir/(.*).html /search/exsearch.php\?dir=$1 [L]
RewriteRule dir/exsearch.php /search/exsearch.php [L]
This allows alll my categories to work like http://mysite.com/search/candles.html
and if I use:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} /search/
RewriteRule search/(.*).html /search/exsearch.php\?advanced=$1 [L]
RewriteCond %{REQUEST_URI} /advanced/
RewriteRule advanced/(.*).html /search/exsearch.php\?advanced=$1 [L]
RewriteRule advanced/exsearch.php /search/exsearch.php [L]
then I can get to the main directory with http://mysite.com/search/1.html
Problem is that I cant figure out how to put both of these sets of rules in one .htaccess file so that I can have:
http://mysite.com/search/1.html
and
http://mysite.com/search/candles.html
and havent figured out how to write the rule for an index.html to take the place of the http://mysite.com/search/exsearch.php
So i need to figure out all 3 of these issues and get them merged in to one file.
I am actually wondering if the index.html is even needed since it doesnt have any characters like "?" "=" in it . Seems like it wouldnt be a problem for search engines but Im not sure.
Any help greatly appreciated.