.htaccess file?

fromthe5

New Member
I want "http://www.mysite.com/blue-widgets.html/" to resolve to "http://www.mysite.com/blue-widgets.html". Is that done in a .htaccess file or is it a separate script?
 

constanthosting

New Member
You said

"http://www.mysite.com/blue-widgets.html/" to resolve to
"http://www.mysite.com/blue-widgets.html"


which is the exact same url?

If you want to redirect users who visit http://yourdomain.com to www.yourdomain.com you could use something like the following in your .htaccess file but you need mod_rewrite available on your host.



RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]


A quick search in a search engine for htaccess redirection will return a lot of results with examples.
 

fromthe5

New Member
which is the exact same url?
It certainly would seem to be, but using
http://www.allmetalsales.com/aluminum-sheet.html gets you there but using
http://www.allmetalsales.com/aluminum-sheet.html/ does not. I have other sites where it "does" work, but not this one. I can't figure out the difference.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Yup. That's already part of my .htaccess file.
 
Last edited:

zkiller

Super Moderator
Staff member
You would need to use mod_rewrite as someone else suggested. However, I don't really see the point in this. It is useful for site like this to create search engine friendly URL's, but it just doesn't make sense when with static html pages.
 

fromthe5

New Member
Thanks Stefan, but I need for this to happen. If it's outside of my realm of knowledge then I guess I'll either have to have it done or actually learn something new. Old dog - new tricks syndrome.
 
Top