The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed May 02, 2012 8:24 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed May 02, 2012 8:19 pm
Posts: 4
Hi all,

I have a domain1 with web hosting and a domain2 without hosting. Domain2 is linked to domain1.
Now I have Joomla 2.5 installed in a subdirectory of domain1. Via .htaccess in the root directory, all requests for http://www.domein2.tld are redirected to http://www.domein1.tld/subdir. So far, so good.
However, all links in Joomla will be displayed with http://www.domein1.tld/subdir/. What I want is that if http://www.domein2.tld is requested, a URL that begins with http://www.domein2.tld also will be displayed in the browser.

In the past it worked fine with a Joomla 1.5 installation and $live_site = 'http://www.domein2.tld' in the configuration.php. Now it is not working anymore. If I use the $live_site then the URLs will start like: http://www.domein1.tld/subdir/www.domein2.tld.
Maybe this is not a good way to manage this.. Does anyone have suggestions how I can solve this or maybe there are different ideas to get this done?

Thanks a lot!


Last edited by humvee on Sat May 05, 2012 10:45 pm, edited 1 time in total.
Marked as resolved


Top
 Profile  
 
PostPosted: Wed May 02, 2012 10:07 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 17, 2005 10:27 pm
Posts: 14709
Location: Kent, England
Please run the Forum Post Assistant to provide the information to help us resolve the issue.


Top
 Profile  
 
PostPosted: Thu May 03, 2012 5:19 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed May 02, 2012 8:19 pm
Posts: 4
Forum Post Assistant (v1.2.1) : 3rd May 2012 wrote:
Basic Environment :: wrote:
Joomla! Instance :: Joomla! 2.5.4-Stable (Ember) 2-April-2012
Joomla! Platform :: Joomla Platform 11.4.0-Stable (Brian Kernighan) 03-Jan-2012
Joomla! Configured :: Yes | Read-Only (444) | Owner: 704 (uid: /gid: ) | Group: 704 (gid: ) | Valid For: 1.5
Configuration Options :: Offline: 0 | SEF: 1 | SEF Suffix: 0 | SEF ReWrite: 1 | .htaccess/web.config: Yes | GZip: 0 | Cache: 0 | FTP Layer: 0 | SSL: 0 | Error Reporting: default | Site Debug: 0 | Language Debug: 0 | Default Access: N/A | Unicode Slugs: N/A | Database Credentials Present: Yes

Host Configuration :: OS: Linux | OS Version: 2.6.18-274.7.1.el5 | Technology: x86_64 | Web Server: Apache | Encoding: gzip, deflate | Doc Root: /var/www/html | System TMP Writable: Yes

PHP Configuration :: Version: 5.3.3 | PHP API: cgi-fcgi | Session Path Writable: Unknown | Display Errors: | Error Reporting: 30719 | Log Errors To: | Last Known Error: | Register Globals: | Magic Quotes: | Safe Mode: | Open Base: | Uploads: 1 | Max. Upload Size: 2M | Max. POST Size: 8M | Max. Input Time: 60 | Max. Execution Time: 60 | Memory Limit: 16M

MySQL Configuration :: Version: 5.0.77 (Client:5.0.77) | Host: --protected-- (--protected--) | Collation: utf8_general_ci (Character Set: utf8) | Database Size: 5.91 MiB | #of _FPA_TABLE: 63
Detailed Environment :: wrote:
PHP Extensions :: Core (5.3.3) | date (5.3.3) | ereg () | libxml () | openssl () | pcre () | zlib (1.1) | bz2 () | calendar () | ctype () | hash (1.0) | filter (0.11.0) | ftp () | gettext () | gmp () | session () | iconv () | pcntl () | Reflection ($Revision: 300393 $) | standard (5.3.3) | shmop () | SPL (0.2) | SimpleXML (0.1) | sockets () | exif (1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $) | tokenizer (0.1) | xml () | cgi-fcgi () | bcmath () | curl () | dba () | dom (20031129) | fileinfo (1.0.5-dev) | gd () | imap () | json (1.2.1) | ldap () | mbstring () | mcrypt () | mysql (1.0) | mysqli (0.1) | odbc (1.0) | PDO (1.0.4dev) | pdo_mysql (1.0.2) | PDO_ODBC (1.0.1) | pdo_sqlite (1.0.1) | Phar (2.0.1) | soap () | wddx () | xmlreader (0.1) | xmlrpc (0.51) | xmlwriter (0.1) | xsl (0.1) | zip (1.9.1) | Zend Engine (2.3.0) |
Potential Missing Extensions :: suhosin |

Switch User Environment (Experimental) :: PHP CGI: Yes | Server SU: No | PHP SU: Yes | Custom SU (LiteSpeed/Cloud/Grid): No
Potential Ownership Issues: Maybe
Folder Permissions :: wrote:
Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (755) | tmp/ (755) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) |

Elevated Permissions (First 10) :: None
Extensions Discovered :: wrote:
Components :: SITE :: com_wrapper (2.5.0) | com_mailto (2.5.0) |
Components :: ADMIN :: com_config (2.5.0) | com_login (2.5.0) | com_messages (2.5.0) | com_banners (2.5.0) | com_admin (2.5.0) | com_weblinks (2.5.0) | com_cache (2.5.0) | com_installer (2.5.0) | Fox Contact Joomla 1.5 (-) | COM_FOXCONTACT (2.0.15) | com_joomlaupdate (2.5.0) | com_templates (2.5.0) | com_categories (2.5.0) | com_content (2.5.0) | com_users (2.5.0) | com_checkin (2.5.0) | com_menus (2.5.0) | com_finder (2.5.0) | com_cpanel (2.5.0) | com_newsfeeds (2.5.0) | com_modules (2.5.0) | com_media (2.5.0) | com_plugins (2.5.0) | com_redirect (2.5.0) | com_languages (2.5.0) | com_search (2.5.0) |

Modules :: SITE :: mod_related_items (2.5.0) | mod_users_latest (2.5.0) | mod_articles_latest (2.5.0) | mod_articles_categories (2.5.0) | mod_articles_category (2.5.0) | mod_search (2.5.0) | mod_footer (2.5.0) | mod_languages (2.5.0) | mod_menu (2.5.0) | mod_breadcrumbs (2.5.0) | mod_weblinks (2.5.0) | mod_articles_archive (2.5.0) | mod_feed (2.5.0) | mod_wrapper (2.5.0) | mod_syndicate (2.5.0) | mod_articles_popular (2.5.0) | mod_login (2.5.0) | mod_random_image (2.5.0) | mod_banners (2.5.0) | mod_articles_news (2.5.0) | mod_custom (2.5.0) | mod_stats (2.5.0) | mod_whosonline (2.5.0) | Fox Contact (2.0.15) | mod_finder (2.5.0) |
Modules :: ADMIN :: mod_toolbar (2.5.0) | mod_multilangstatus (2.5.0) | mod_submenu (2.5.0) | mod_menu (2.5.0) | mod_popular (2.5.0) | mod_logged (2.5.0) | mod_feed (2.5.0) | mod_login (2.5.0) | mod_title (2.5.0) | mod_version (2.5.0) | mod_custom (2.5.0) | mod_status (2.5.0) | mod_quickicon (2.5.0) | mod_latest (2.5.0) |

Plugins :: SITE :: plg_editors_tinymce (3.4.9) | plg_editors_codemirror (1.0) | plg_system_languagecode (2.5.0) | plg_system_debug (2.5.0) | plg_system_log (2.5.0) | plg_system_highlight (2.5.0) | plg_system_languagefilter (2.5.0) | plg_system_logout (2.5.0) | plg_system_sef (2.5.0) | plg_system_cache (2.5.0) | plg_system_p3p (2.5.0) | plg_system_remember (2.5.0) | plg_system_redirect (2.5.0) | plg_quickicon_extensionupdate (2.5.0) | plg_quickicon_joomlaupdate (2.5.0) | plg_editors-xtd_image (2.5.0) | plg_editors-xtd_article (2.5.0) | plg_editors-xtd_pagebreak (2.5.0) | plg_editors-xtd_readmore (2.5.0) | plg_authentication_joomla (2.5.0) | plg_authentication_gmail (2.5.0) | plg_authentication_ldap (2.5.0) | plg_captcha_recaptcha (2.5.0) | plg_extension_joomla (2.5.0) | plg_user_profile (2.5.0) | plg_user_joomla (2.5.0) | plg_user_contactcreator (2.5.0) | plg_finder_newsfeeds (2.5.0) | plg_finder_weblinks (2.5.0) | plg_finder_content (2.5.0) | plg_finder_contacts (2.5.0) | plg_finder_categories (2.5.0) | plg_search_newsfeeds (2.5.0) | plg_search_weblinks (2.5.0) | plg_search_content (2.5.0) | plg_search_contacts (2.5.0) | plg_search_categories (2.5.0) | googleMaps (2.5.19) | plg_content_loadmodule (2.5.0) | plg_content_emailcloak (2.5.0) | googleDirections (2.5.12) | plg_content_vote (2.5.0) | plg_content_geshi (2.5.0) | plg_content_joomla (2.5.0) | plg_content_pagenavigation (2.5.0) | plg_content_finder (2.5.0) | plg_content_pagebreak (2.5.0) | Simple Image Gallery Pro (by J (2.5.7) |
Templates Discovered :: wrote:
Templates :: SITE :: beez5 (2.5.0) | beez_20 (2.5.0) | atomic (2.5.0) | sensory (1.0.2.5) |
Templates :: ADMIN :: bluestork (2.5.0) | hathor (2.5.0) |


Top
 Profile  
 
PostPosted: Thu May 03, 2012 8:07 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Wed Aug 17, 2005 10:27 pm
Posts: 14709
Location: Kent, England
thanks for that.
It is clear that you have the .htaccess file in use, have you checked that the entries in there have also been amended where appropriate for the change of directory? In particular mod_rewrite for SEF functionality.

Also check that any extensions that have their own configuration file that makes reference to the path are also amended.


Top
 Profile  
 
PostPosted: Thu May 03, 2012 8:40 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed May 02, 2012 8:19 pm
Posts: 4
Thank you for your reply.
Yes indeed, I have the .htaccess file in use but I have changed nothing in the file yet.
I only changed the .htaccess in the root directory to redirect all requests for domain2.tld.

I don’t know enough of the use of mod_rewrite for SEF so I will have to read some articles and learn. I hope I can manage it. :)

Thank you very much for your help!


Top
 Profile  
 
PostPosted: Sat May 05, 2012 7:01 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Jan 30, 2011 10:09 am
Posts: 130
Location: Leicester, UK
I do this by parking domain2 on domain1 in my cPanel. You also need to update the nameservers on domain2.

http://docs.cpanel.net/twiki/bin/view/1 ... kedDomains

_________________
Nanagram Websites and Hosting: http://www.nanagram.co.uk


Top
 Profile  
 
PostPosted: Sat May 05, 2012 8:10 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed May 02, 2012 8:19 pm
Posts: 4
After some searching, I think to have it resolved by the .htaccess file in the root.
The main domain is redirected to a subdirectory and the linked second domain is redirected to a different subdirectory.
The .htaccess of Joomla I have left intact, just changed in configuration.php $live_site = 'http://www.domain2.com'.

Below the .htaccess file (root) ..
No idea if the following mod_rewrite is ok but it works for me..


Code:
 Options +FollowSymLinks

 RewriteEngine On

# Add www to url (change http://domain.com to http://www.domain.com)
 RewriteCond %{HTTP_HOST} ^domain1.com$
 RewriteRule ^/?(.*)$ http://www.domain1.com/$1 [R=301,L]
 
# Add www to url (change http://domain.com to http://www.domain.com)
 RewriteCond %{HTTP_HOST} ^domain2.com$
 RewriteRule ^/?(.*)$ http://www.domain2.com/$1 [R=301,L]

# Add missing trailing slashes
 RewriteCond %{ENV:REDIRECT_STATUS} ^$
 RewriteCond %{HTTP_HOST}/subdir1  ^(www\.)?domain1\.com(/subdir1)$  [NC,OR]
 RewriteCond %{HTTP_HOST}/subdir2  ^(www\.)?domain2\.com(/subdir2)$ [NC]
 RewriteCond %{DOCUMENT_ROOT}%2%{REQUEST_URI}/ -d
 RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

# Redirect to subdirectories
 RewriteCond %{ENV:REDIRECT_STATUS} ^$
 RewriteCond %{HTTP_HOST}/subdir1  ^(www\.)?domain1\.com(/subdir1)$  [NC,OR]
 RewriteCond %{HTTP_HOST}/subdir2  ^(www\.)?domain2\.com(/subdir2)$ [NC]
 RewriteRule .* %2%{REQUEST_URI} [QSA,L]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: doone and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group