Welcome to WebmasterWorld Guest from 34.229.194.198
Forum Moderators: Ocean10000 & phranque
if trailing slashes are missing the page still needs to work.
currently the rewrite rule is stored in a .htaccess file inside the widget folder I can get the following to work
www.com/widget/
www.com/widget/foo/
www.com/widget/foo/bar/
but www.com/widget (minus the trailing /) gives this
www.com/widget?var1=C:&var2=Inetpub/wwwroot/site/widget
which shows the right webpage but is an ugly URL.
Here's my code
RewriteEngine On
RewriteRule ^([^/]+)/(.+)$?artist=$1&album=$2
RewriteRule ^([^/]+)$ $1/
RewriteRule ^([^/]+)/$?artist=$1
I think the first rule is giving the problem above but, a sit stands playing around with it I can't manage to get all three combos to work. There is no rewrite rule in the parent folder conflicting with it.
any clues?
p.s. I have read the mod_rewrite manual and numerous tutorials but am still stuck. Help.
Rewrite from /widget/ or /widget to /widget?query=abc
Rewrite from /widget/foo/ or /widget/foo to /widget/foo?query=abc
I attempted to derive this from your posted rules, but only the second one has correct syntax; The others are missing either the substitution URL or a space between the pattern and substitution URL. So I don't know what you are trying to accomplish.
Jim
RewriteEngine On
RewriteRule ^([^/]+)/(.+)$?var1=$1&var2=$2
RewriteRule ^([^/]+)$ $1/
RewriteRule ^([^/]+)/$?var1=$1
I am attempting to get
www.com/widget/foo/bar/ from?var1=foo&var2=bar
www.com/widget/?var1=C:&var2=Inetpub/wwwroot/site/widget
RewriteEngine On
RewriteRule ^([^/]+)/(.+)$ /widget/?var1=$1&var2=$2 [L]
RewriteRule ^(.+)$ /widget/?var1=$1 [L]
Jim
This code
RewriteEngine On
RewriteRule ^([^/]+)/(.+)$?artist=$1&album=$2 [L]
RewriteRule ^([^/]+)/([^/]+)$?artist=$1&album=$2 [L]
RewriteRule ^([^/]+)$ $1/ [L]
RewriteRule ^([^/]+)/$?artist=$1 [L]
seems to work for everything except www.com/widget which redirects to www.com/widget?var1=C:&var2=Inetpub/wwwroot (on windows) and produces a 500 error (on Linux) - NB. the site sits as a subdomain of another domain and has its own unique domain name.