Thread: htaccess help
View Single Post
Old 11-27-2012, 04:56 PM   PM User | #2
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
This is what I use to force a "www" prefix:

Code:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
I'm not sure if your version is the cause of your problem or not, but I at least like the portability of my version.

For the second part, I think your syntax is backwards (your match and replacement are reversed). And to get the numbered items into a single line you use a regular expression match instead of the literal string you are trying to match. Try this (untested):

Code:
#note: I'm not sure if the question mark needs to be escaped or not, but I went ahead and escaped it...
RewriteRule ^(offer.php\?pos=[0-9]) offer-1$ [L]
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote