Jump to content

Renaming main (root) folder


Bryan_TAO

Recommended Posts

Hi folks .... I started putting together a Webstore in a folder called /Cubecart and hadn't realised just how much valid work I had done on behalf of my client before wanting to change the root folder name. I have taken a copy of this folder and then uploaded again as /theclientsname and everything seems to work just fine .... the cart is using the same DB and the DB has not been moved or renamed. QUESTION: Have I created any problems ahead of me by doing this? If there's any doubt to the stability of the install now then I'd rather start again and install / setup the prog in the client's folder from scratch. But if it's not necessary I can save myself some work! Thank you. Bryan.

Link to comment
Share on other sites

In the .htaccess file (a collection of directives for the web server):

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /subfolder

The first directive starts processing the following group of directives if the web server (Apache?) has loaded the URL Rewrite functions.

If so, the second directive tells the web server to activate those URL Rewrite capabilities.

The third directive tells the web server that URLs of the form:
www.website.com/subfolder/friendly-cat-name/friendly-subcat-name/friendly-product-name.html
that /subfolder is not part of the overall SEO-friendly name of the page.

Thus, when rewriting the URL - the final directive of the group - the /subfolder part stays as part of the legitimate URL, and the web server starts looking for /subfolder/index.php. Without the RewriteBase directive, or an incorrect value, the rewriting will include /subfolder as part of the SEO-friendly name, or will be looking for index.php in the wrong folder..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...