Forum Moderators: phranque

Message Too Old, No Replies

htaccess RedirectRule help

         

MaryUK

7:14 pm on Jan 30, 2010 (gmt 0)

10+ Year Member



hi all

i have links like this

[domain.com...]

i want it like

[domain.com...]

or

[domain.com...]

i want it like

[domain.com...]

This is my htaccess
ErrorDocument 404 /

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ [domain.com...] [L,R=301]

RewriteRule ^([^-]+)-category$ index.php?cat=$1 [L]

thanks

g1smd

7:35 pm on Jan 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll need to repost the question using EXAMPLE.COM as it is IMPOSSIBLE to read the question.

MaryUK

7:54 pm on Jan 30, 2010 (gmt 0)

10+ Year Member



hi all

i have links like this

http://www.example.com/?cat=1
i want it like
http://www.example.com/Category1/

or

http://www.example.com/?cat=2
i want it like
http://www.example.com/Category2/

This is my htaccess


ErrorDocument 404 /
#
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
RewriteRule ^([^-]+)-category$ index.php?cat=$1 [L]

================

Can u read now?

[edited by: jdMorgan at 10:20 pm (utc) on Jan. 30, 2010]
[edit reason] example.com [/edit]

jdMorgan

12:26 pm on Jan 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may find this thread [webmasterworld.com] in our Forum Library to be of use. It seems you've already taken one or two steps of the three-step process.

Jim

MaryUK

10:12 am on Feb 4, 2010 (gmt 0)

10+ Year Member



i have hostgator shared hosting , no ssh access :(

i have links like this

http://www.example.com/?cat=1
i want it like
http://www.example.com/Category1/

g1smd

8:34 pm on Feb 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If your LINKs are wrong, you need to change the links.

Rewrites deal with the request coming to the server after the link is clicked. The link on the page needs to show the right URL. Mod_Rewrite cannot change those links.