Redirect like... Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^shop/([^.]+)$ http://www.domain.com/$1/ [R=301,L] or RewriteRule ^whatever/$ http://www.domain.com/ [R=301,L] If you don't have the PR now...I think you'll have to waite until the next update to get it back! This just moves existing PR, and makes the old URL go to the new URL!!!!
Great tutorial... Now all my URLs become static. Thanks Nintendo! Adding to php->html mod rewriting, I want to give a 301 redirect to the dynamic pages listed SE. Any ideas to implement it? I ended up with infinite loop.
Hi Nintendo: I have encountered bit of a google high ranking mystery and am wondering if you think that mod_rewrite might have something to do with it. If you put in the term "rimage" in google, this subdomain name comes up ranked as number 2: http://rimage.cd-lab.com I think the great ranking is only because its a subdomain with the term "rimage" in it and its using mod_rewrite? I cant find any other content for this subdomain and it has relatively low pagerank. when I click on any link on the subdomain page, it immediately reverts to the main domain name www.cd-lab.com. I am considering using this subdomain "technique" (?) for various vendor names (like "rimage") to get better ranking. Does it make sense for me to this as a valid SEO technique. CJ
I'm changing two sections of my site, so that all images are on the same page as the relevant information as oppose to individual pages, so this means hundreds of Redirect 301's, can I minimise this down anyway?? 1st - I have - pic_ref_a/number.php redirected to ref_a.php redirect 301 /folder/ref_a.php http://www.site.com/folder/pic_ref_a/1.php redirect 301 /folder/ref_a.php http://www.site.com/folder/pic_ref_a/2.php redirect 301 /folder/ref_a.php http://www.site.com/folder/pic_ref_a/3.php Then redirect 301 /folder/ref_b.php http://www.site.com/folder/pic_ref_b/1.php redirect 301 /folder/ref_b.php http://www.site.com/folder/pic_ref_b/2.php ETC....... Can I reduce this??? 2nd - With this I think I can't do anything as each image ID relates to a certain property ID and unless you know the image id you don't know which property it relates too! redirect 301 /folder/image.php?imageID=74&type=listing http://www.site.com/folder/listingview.php?listingID=10 Also how long should you keep a 301 redirect active for?? Thanks for any help. Ian
If they all go to the same place, from folder/pic_ref_a/ANY NUMBER.php to /folder/ref_SAME LETTER.php Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^folder/pic_ref_a/([^.]+)\.php$ http://www.domain.com/folder/ref_a.php [R=301,L] RewriteRule ^folder/pic_ref_b/([^.]+)\.php$ http://www.domain.com/folder/ref_b.php [R=301,L] I've used redirect twice and havn't took it down.
Thnaks for that Nintendo, works a treat. Keep feeding that rat and you might work a miricle on it! Thanks again. Ian
I have a 700-page travel site. The original pages had simple, SEO-friendly page names ending in .jsp. We were in the process of migrating to a PHP server and are using HTAccess to read the .jsp pages as if they were .html pages....but now I'm leaning instead towards having someone rebuild the site in Drupal or another CMS. It would make my life so much easier. Many of our current pages are well-ranked in the search engines, and I don't want to lose that. However, we're a new site, so we don't have that many incoming links yet. If I use Drupal, the only change I'd need to make to the page name, I believe, is to lose the .jsp extension. If I do that, and use a 301 redirect, from a search engine's perspective, have I lost anything at all? (If yes, then can/should I use HTAccess or ModRewrite to have Drupal add the .jsp extensions to my page names?)
You can't do both mod_rewrite AND 301 redirect for a old and new URL. The URLs will fight over each other!! No, rewrite, no redirect, no, rewrite, no redirect...
Why fight when you can make sweet sweet love? Another thing I've noticed I can't seem to be able to redirect let's say www.domain.com/ to www.domain.com/index.php
I havn't tried it, but if it's just an extension change, include the domain name in the left URL AND extension instead of just domain.com. I'm guessing that would work.
Hi I am trying to allow a web page with a php extension to be written with a html extension. And after changing a bit of code that I foun online this seemed to work.... RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule (.*/)([^.]+)\.php /$1$2%2.html?%1%3 [R] from http://www.mydomain.com/content/catergories.php to http://www.mydomain.com/content/catergories.html This kinda worked... in terms of the url it translated it fine - but the functionality of the php page did not. The catergories.php consisted of a template which used some php variables. It also referenced (as main body of template) to a html page - infocatergories.html. The results of the above action meant that only the html page (infocatergories.html) was shown and none of the template that was setup using templates and php. What am I doing wrong? or is this normal and a limitation? Thanks in advance, Joe p.s. do search engines prefer *.htm or *.html (No worries if that is a very subjective thing and a whole new post on its own)
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)\.html$ $1/$2.php [L] or for one file... RewriteRule ^content/catergories\.html$ content/catergories.php [L]
Hi - thanks for the swift reply I think I was getting a bit mixed up with redirecting and transforming the url!! I have fiddled around experimenting with .htaccess file. Previously I have been able to 1) redirect a page and 2) tranform the url - and still point to the same page. For some reason I can now only redirect. I am using the exact same code and entering it into the .htaccess file as before. the code is: RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^listings/([A-Za-z]+)_times\.html$ /includes/listings\.php?srchBox1=$1 I also tied RewriteRule ^([^.]+)/([^.]+)\.html$ $1/$2.php [L] as suggested, but with no joy.... Any suggestions please? Joe
Hi, I got a .htaccess mod to create dynamic SubDomain Style URLs for my users. I want to ask is it possible to have group of subdomain hosted on different IP address? Regards.
I havn't ever been able to do both, due to the infinite loof, it fighting over what it wants to do, change URL, or redirect. Make a new thread for that. I've never done sub-domain stuff.
The problem I am now facing is that I can no longer transform the url address at all. I am no longer trying to redirect I have just : RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^listings/([A-Za-z]+)_times\.html$ /includes/listings\.php?srchBox1=$1 in the .htaccess file Is there something that I may have changed that needs re-setting. The reason I ask is beacause I am sure the above code worked a couple of days ago. Cheers, Joe
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^listings/([^.]+)_times\.html$ includes/listings.php?srchBox1=$1 [L]