I just realize that I was confusing those 2 terms, Imagine the poor newbie trying to grasp the concept....Question 3 - Do you really mean redirect or do you mean rewrite?
No, I don’t want the folder name to appear.
So the far what I use in my setups are —>
I htaccess in the root + the normal Joomla htacces (in the subfolder)
I use this because I wasn’t sure to merge the 2, but now you tell me to do so (and probably keep only the one in the root)
My actual root ( I wasn’t able to do a permanent redirect sofar)
Code: Select all
# Use PHP5CGI as default
AddHandler fcgid-script .php
# mysitename.ca
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?mysitename.ca$ [NC]
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/mysubfoldername/
# Don't change these lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /mysubfoldername/$1 [L]
# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?mysitename.ca$ [NC]
RewriteRule ^(/)?$ mysubfoldername/index.php [L]
1— My configuration.php
Code: Select all
as var $live_site = 'http://www.mysite.com' "
# RewriteBase / —> (Still not active and commented)
I know it should be uncommented with the subfolder name to keep it out of the URL
but this setup do take out the subfolder name but leave me with 2 htaccess and a temporary redirect.
As you saying what I shoud have is one htacces and (I guess) should have a Permanent redirect.... 301
Other Stuff.................
This is my Glossary so far to be part of the final doc I will post here on the subject of Redirect, Rewrite and SEO - SEF
If you have time you can comment on those definition....
Glossary:
—————————————————————————————————————
Understanding Redirect
This is my definition
Web server have as default setting to look for a file like index.html or index.php to display when an url is search by your browser.
e.g. If you type —> http://www.joomlacode.org the network search by default (whitout any rules in an htacces file) for a file index.html or index.php (in order of research html first, php after) to display a site or a unique file. In the case of http://www.joomlacode.org or www.joomlacode.org you will see that whatever you type you will see the final adress to be http://joomlacode.org/ This happen because you have a basic rule in the htaccess that “Redirect” http://www.joomlacode.org or www.joomlacode.org and http://joomlacode.org or even only joomlacode.org to the the same unique starter file and URL.
Proper redirects is the most important SEO and SEF Step and can even have a real impact on the overall speed of your site.
—————————————————————————————————————
—————————————————————————————————————
Difference between Rewriting and Redirecting?
Redirecting and rewriting are distinct, although many people use the terms interchangeably. It's better to understand the differences clearly, so you know how to do what you want with your server.
The main difference between Rewrite and Redirect can be described succintly:
• Rewrite is a Server-Side operation
• Redirect sends an immediate response to the Client
Rewriting is a Server-side operation
"The request is rewritten" means that on the server side, the result of the rewrite is served. The result could be a static page, or an image file, or a dynamic page (like a php page or an aspx page). Regardless of the result of the URL rewrite, the browser is not notified that a rewrite has occurred, inside the web server.
Using a rewrite, the browser can ask for http://myserver.com/definition/soccer.htm and receive the contents of c:\definition\football.htm, but will remain unaware that the server has done this substitution. The URL in the browser still reflects what the browser originally requested: /definition/soccer.htm.
This is a cause for confusion among many people, so I will repeat it: the browser cannot detect if the server has rewritten its request. There is no difference to the browser. If a server URL rewrite occurs, the browser is not informed. No update of the address in the browser URL address bar occurs, in the event of a rewrite.
Redirect sends an immediate response to the Client
A redirect implies sending an HTTP response to the client, with a new URL. Using a rewrite, the browser can ask for http://myserver.com/definition/soccer.htm and the server responds, effectively "No, you don't want football.htm, what you really want is soccer.htm". The server sends back an HTTP reply, with a response code of 301 (Moved Permanently) or 302 (Moved Temporarily), with a new URL http://myserver.com/definition/football.htm. Normally, when receiving the browser will update the browser address bar, and then make a new request for that new URL.
You can use Redirect and Rewrite together
In many cases, a set of rules will include both RewriteRule directives and RedirectRule directives. For example, often rules will redirect erroneous or malformed requests to a "Not Found" page, while correctly formed requests might get rewritten on the server side.
—————————————————————————————————————
—————————————————————————————————————
Permanent and Temporary redirect
Permanent 301
To summarize in a few lines, permanent 301 redirects are just as they sound. They are permanent redirects from an old URL to a new one (or a new domain/site alltogether). These redirects tell the search engines that the old location is to be removed from their index and replaced with the new location. Using 301 redirects is the most search engine friendly way to redirect traffic and engines, and far out weighs that of various JavaScript and Meta refresh redirects.
Temporary 302
Temporary 302 redirects are also as they sound; temporary. They are best use when moving an site to a new domain. Temporary redirects are telling the search engines to read and use the content on the new page, but to keep checking the original URL first as it will ultimately be reestablished.
—————————————————————————————————————