Forum Moderators: phranque
I am trying to rewrite
http://www.example.com/dir/area/
or
http://www.example.com/dir/2/
to
http://www.example.com/dir/index.php?action=showcat&idcat=2
i have tried
RewriteEngine On
RewriteRule ^dir/([1-9][0-9]*)/ index.php?action=showcat&idcat=$1 [L]
RewriteEngine On
RewriteRule ^dir/(.*)/ index.php?action=showcat&idcat=$1 [L]
with and without
Options FollowSymLinks
and
Rewritebase /dir
or
Rewritebase /
my host does support rewrite, i have various accounts that use it without problems
Any suggestions appreciated
The urls posted keep showing as links so i stopped them, i presume thats correct on this board?
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^dir/([^/]+)/ index.php?action=showcat&idcat=$1 [L]
Jim
i tried that code but it still wouldnt work, but it works fine if i add
rewritebase /dir
is this ok?
also am i correct in thinking this would be ok for extra page query
RewriteRule ^dir/([^/]+)/([^/]+)/ index.php?action=showcat&idcat=$1&page=$2 [L]
can this ignore images or shall i change the image path out of "dir"
Thank again
If needed, add a RewriteCond to ignore images for a single rule, or use mod_rewrite's "Skip" capability to ignore images for multiple RewriteRules:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /dir
RewriteRule \.(gif¦jpe?g¦png¦ico)$ - [NC,S=2]
RewriteRule ^dir/([^/]+)/([^/]+)/ index.php?action=showcat&idcat=$1&page=$2 [L]
RewriteRule ^dir/([^/]+)/ index.php?action=showcat&idcat=$1 [L]
Jim
Please help, i need to change this rewrite around so it ignores a directory:
RewriteEngine on
RewriteBase /dir
RewriteRule \.(gif¦jpe?g¦png¦ico)$ - [NC,S=2]
RewriteRule ^dir/([^/]+)/([^/]+)/ index.php?action=showcat&idcat=$1&page=$2 [L]
RewriteRule ^dir/([^/]+)/ index.php?action=showcat&idcat=$1 [L]
i need it to ignore
http://www.example.com/dir/admin/
Many Thanks
The links in our charter [webmasterworld.com] may be helpful.
Jim