2

I used the procedure of this answer ( https://joomla.stackexchange.com/a/7613/1685 ) to backup my site on a local.

I did the extraction and the installation in a subdir (/var/www/html/my_dir/) of the localhost path (/var/www/html/). The entire procedure gave me no errors but if I access to the local site (localhost/my_dir) I see the homepage exactly as it should be but other pages are wrongly linked. If a click to a link to page2 the browser go to localhost/index.php/page instead of going to localhost/my_dir/index.php/page and clearly a get a "Not found" error message. If I go manually (typing the right address) to page2, the page looks correct.

I think there is some option that has to be setted to let joomla recognise that I have a subdir but I don't know how to set it.

10
  • In your configuration.php file, try using localhost/my_dir for the $live_site variable. I personally always use a Virtual Host so problems like this never occur. If you want to know how to set one up, please have a look at the following tutorials
    – Lodder
    Feb 16, 2015 at 15:30
  • @Lodder already tried, ot doesn't work. Not only the links remain wrong but also the homepage is no more rendered correctly (missing images and probably some .css files)
    – Red
    Feb 16, 2015 at 15:34
  • And have you made any manual changes to your htaccess file?
    – Lodder
    Feb 16, 2015 at 15:34
  • @Lodder no, no changes
    – Red
    Feb 16, 2015 at 15:35
  • well personally I would go down the Virtual Host route. I believe this will also solve your issue, but before, can you try rebuilding your menu items as shown in this screenshot
    – Lodder
    Feb 16, 2015 at 15:36

2 Answers 2

1

I'm not too sure of the technical terms and why this will work, but I would suggest creating a Virtual Host. Using this will allow you to use a domain (so to speak), such as joomla.loc which you can map to the existing Joomla installation directory.

Using sub-directories for websites can start causing lots of issues, especially with CMS's such as Jomla or Wordress, therefore when creating a new installation on the same server, it's best to use subdomains (live host) or virtual host (localhost).

The following tutorials that have been compiled for different environments can be found here:

https://joomla.stackexchange.com/a/4157/168

1

This sounds like an error with your .htaccess file. check the following line:

RewriteBase /

As you're running on localhost within a sub-Directory (your main "domain" is http://localhost), you should set it to RewriteBase /my_dir (replace my_dir with the actual Directory of your Joomla installation.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.