| | |
301 Rediret Help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 89
Reputation:
Solved Threads: 4
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.
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.
•
•
Join Date: Oct 2008
Posts: 89
Reputation:
Solved Threads: 4
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
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
do you mean you want to redirect e.g. www.linkzdirect.com/pritaeas to pritaeas.linkzdirect.com ? Something like this perhaps ?
RewriteCond %{HTTP_HOST} ^www.linkzdirect.com$
RewriteRule ^(\w+)$ http://$1.linkzdirect.com [301,L]
Docs:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
RewriteCond %{HTTP_HOST} ^www.linkzdirect.com$
RewriteRule ^(\w+)$ http://$1.linkzdirect.com [301,L]
Docs:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: Oct 2008
Posts: 89
Reputation:
Solved Threads: 4
yup thts wht i want. sweet thx let me try if that works and thanks for the tut link
![]() |
Similar Threads
- custom .htaccess file 301 Redirect to non www form (Search Engine Optimization)
- Help with 301 redirect code - jsp in url (JSP)
Other Threads in the PHP Forum
- Previous Thread: advice from thesis
- Next Thread: Greeting the Guests & Users
| Thread Tools | Search this Thread |
.htaccess 301 access adware asp.net background bitmap bmp broken c# c++ clean content cron desktop domain download duplicate dynamic file filter frames function google htaccess html image ip job jsp limit link malware match mediawiki mod_rewrite python redirect redirecting response rss sessions stream url urllib2 vista web






