× Here you can get community support related to ReDJ.

Add a 301 htaccess for a site in a subfolder ?

More
11 years 7 months ago - 11 years 7 months ago #961 by admin
Problem now is clear and I really appreciate you trust me. But Joomla credentials you provided to me don't work. :)
Last edit: 11 years 7 months ago by admin.

Please Log in or Create an account to join the conversation.

  • Chacapamac
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 7 months ago #962 by Chacapamac
Replied by Chacapamac on topic Add a 301 htaccess for a site in a subfolder ?
I made a mistake — I send you another email.. really sorry

Kind of tired today....

Please Log in or Create an account to join the conversation.

  • Chacapamac
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 7 months ago - 11 years 7 months ago #964 by Chacapamac
Replied by Chacapamac on topic Add a 301 htaccess for a site in a subfolder ?
The typical 404 old url is:

www.avocatshorsquebec.org/site/en/contactez-nous.html

All the old addresses have the site folder showing in the url
All the old adresses end with useless .html because it was set in the Configuration of Joomla


The actual root 301 htaccess redirect to the subfolder /site/

# 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.

# Replace avocatshorsquebec.org and /site/ with the real names.

# Redirect to canonical hostname and rewrite to internal site.

# Activate the rewrite engine
RewriteEngine on

# 1. Redirect non-canonical hostame requests to www.avocatshorsquebec.org
RewriteCond %{HTTP_HOST} !^(www\.avocatshorsquebec\.org)?$
RewriteRule (.*) www.avocatshorsquebec.org/$1 [R=301,L]
RewriteRule ^site\/index\.php$ "www.avocatshorsquebec.org/index.html" [R=301,L]

# 2. Rewrite root request to index file in site
RewriteRule ^$ /site/index.php [L]
#RewriteRule !. /site/index.php [L]
# (pick one of the above two lines, they are equivalent)

# 3. Rewrite requests to site
# If the request has not already been rewritten to /site/
RewriteCond %{REQUEST_URI} !^/site/
# and is not a request that is always handled by a file
RewriteCond %{REQUEST_URI} !(site).\.(png|gif|jpe?g|css|js|zip|txt)$
# and does not actually exist as a file or folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# rewrite the request to be handled by the folder
RewriteRule (.*) /site/$1 [L]


The joomla htaccess hide the subfolder name

##### RewriteBase set - BEGIN
RewriteBase /site

• configuration.php have —> www.avocatshorsquebec.org as live Site


The 404 error are piling up fast
www.avocatshorsquebec.org/site/en/home-mainmenu-1/187-exercice-de-la-profession-hors-quebec-un-rapport-a-lhiver-2011.html

www.avocatshorsquebec.org/site/en/home-mainmenu-1/156-mot-du-president.html

www.avocatshorsquebec.org/site/en.html?start=4

www.avocatshorsquebec.org/site/en/contactez-nous.html

Even the Feed is not good anymore....
avocatshorsquebec.org/site/en.feed?type=atom

I’m to the point to put back the stupid old scheme to stop the bleeding..... :oops:
Last edit: 11 years 7 months ago by Chacapamac.

Please Log in or Create an account to join the conversation.

  • Chacapamac
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 7 months ago #965 by Chacapamac
Replied by Chacapamac on topic Add a 301 htaccess for a site in a subfolder ?
I didn't have no choice that to revert....

What I did:

• I leave Redj on with you redirection item On — Don’t seem to take effect....
• The Root 301 htacces redirect wasn’t touch
• The Joomla htacces “Base” settings — I take the name of the subfolder out (/site)
• Live Site in configuration.php was return to —> www.avocatshorsquebec.org/site

and Joomla Configuration return to “Add Suffix”

Sadly?

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #967 by admin
Ok,
maybe we should start from your first request:

I add a 301 redirect for a 1.5 site in a subfolder (name = site)

root —> site (joomla)

Everything work perfectly - I got a 301 redirect and the name of the subfolder is gone...

www.avocatshorsquebec.org/

Can I use RedJ to redirect any old url with the old www.avocatshorsquebec.org/site/whatever... to

www.avocatshorsquebec.org/whatever...


I thought you would like to move the site from the subfolder, but now I'm almost sure you would like to mantain your Joomla site under a /site subfolder of the web server, but you would also like that Joomla generated its URL without the /site part.

Is it so?

If this is what you need, maybe it could be done with ReDJ Enterprise (with the Community you will be always redirected to a visible /site URL). But this is not the best solution. You should move your site from the subfolder. If this is not possible (but I don't see a reason) you could do something with Virtual Host configuration. But redirect ANY single URL is not a solution I can promote.

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • Chacapamac
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 7 months ago #970 by Chacapamac
Replied by Chacapamac on topic Add a 301 htaccess for a site in a subfolder ?
I’m so sorry to send many informations in a short notice, but I was in a panic state when I saw the 404 piling up — Thanks to your component showing them (and their referrer) :silly:
Note: Just for the ability to show those errors and the controls of the errors pages your component is now on my list of first install for all my future sites... Really Good- Thanks

I see no problems, and, in fact, will really prefer to move the site from it’s subfolder to the root as it’s always the best way to obtain clean redirect...

In fact, I keep it under the “site” subfolder” because I knew that it will be difficult to redirect all those old address with the “sites” subfolder and the silly “html” at the end to the new address.
I’m far from a pro on redirection by htaccess and RedJ was my only option....

What I think will be the best:
• The site out of “site” subfolder” and in the root with the normal joomla htacces (the one I have now, with my added security) with a clean 301 redirect — I have no problem to do that myself

• Put off the Add suffix to URLs in Joomla Global Config to take out those .html at the end

• Now the problem is to redirect all those old addresses with the now deleted “site” subfolder and ending with the .html suffix to the new clean domain URL...

I need to be sure to be able to do redirect correctly before starting the changes, I lost a bit of hair those few days !! :woohoo:

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds