hello everyone.
im using a cms and i have just changed the strucutre of my site's url making changes in the core files.

here is an example what i have done.
at first urls were:
http://www.linkzdirect.com/photo/gallery/picture-name

now they are chagned to :
http://www.linkzdirect.cm/art/gallery/picture-name

everything seems to be working fine. i also made these chagnes in .htacess. works fine.

but a large number of my site's pages are indexed in google and other engines and i get traffic from that. so is there a way i can put a redirect code in .htacccess and it will redireect all the url containing photo/gallery/ to art/gallery/

here is a little example of code written in my .htaccess.
RewriteRule ^art/all/([0-9]+)/([0-9]+)/{0,1}$ browsePhoto.php?page=$2&per_page=$1 [QSA,L]
RewriteRule ^art/gallery_top/{0,1}$ browsePhoto.php?rate=top [QSA,L]

At First Art word was as Photo.
Help is Apprecited.
thanks in advance.

Recommended Answers

All 5 Replies

hey man thank u so much :) it worked like a charm , im really grateful to u .
there is one more thing i would like to ask :)
i have also changed the profiles from www.linkzdirect.com/username to uesrname.linkzdirect.com by wildcard dns and blah blah blah it works like a charm but i still hvent been able to figure out a 301 redirect for it as well.

here is the original code.:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L]

its replaced to :

RewriteCond %{HTTP_HOST} ^([^w]{3}.*).linkzdirect.com$
RewriteRule ^$ /profile.php?ID=%1 [QSA,L]
RewriteCond %{HTTP_HOST} ^([^w]{3}.*).linkzdirect.com$
RewriteRule ^/(.+)$ /$1 [QSA,L]

so i would really really apprecite man if u can guide me in this as wel. plus i need to learn .htaccess redirect can u give me a good tutorial link to.
thanks again bro :)

yup thts wht i want. sweet thx let me try if that works and thanks for the tut link :)

hey again. nop didnt worked getting a 500 server error. Want me to share teh full .htaccess file?
Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.