<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: colebidex2483</title>
    <description>The latest articles on DEV Community by colebidex2483 (@colebidex2483).</description>
    <link>https://dev.to/colebidex2483</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F822080%2F62b1ec83-9d68-4c08-a0d6-0d8e51c173b2.png</url>
      <title>DEV Community: colebidex2483</title>
      <link>https://dev.to/colebidex2483</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/colebidex2483"/>
    <language>en</language>
    <item>
      <title>How to Properly Host a Vue.js App in a Subdirectory of public_html</title>
      <dc:creator>colebidex2483</dc:creator>
      <pubDate>Mon, 10 Mar 2025 04:39:49 +0000</pubDate>
      <link>https://dev.to/colebidex2483/how-to-properly-host-a-vuejs-app-in-a-subdirectory-of-publichtml-gm0</link>
      <guid>https://dev.to/colebidex2483/how-to-properly-host-a-vuejs-app-in-a-subdirectory-of-publichtml-gm0</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’ve ever tried to deploy a Vue.js application inside a subdirectory of your public_html folder, you might have run into frustrating issues—blank pages, missing assets, or routing failures. I’ve been there. Despite following different guides and tweaking configurations, the app just wouldn’t load properly.&lt;/p&gt;

&lt;p&gt;But after a lot of trial and error, I finally got everything working. If you’re struggling with the same issue, this guide will walk you through the exact steps to successfully deploy your Vue.js app in a subdirectory.&lt;/p&gt;

&lt;p&gt;I also came across a similar problem &lt;a href="https://stackoverflow.com/questions/75305620/vue-js-dist-folder-when-copied-to-shared-hosting-sites-subfolder-is-not-renderi" rel="noopener noreferrer"&gt;similar problem&lt;/a&gt; where the issue couldn’t be resolved. Instead, resolved to use a subdomain. However, if you prefer using a subdirectory, follow along.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, Vue assumes your app will be hosted at the root of a domain (e.g., &lt;a href="https://yourdomain.com/" rel="noopener noreferrer"&gt;https://yourdomain.com/&lt;/a&gt;). But when you deploy it inside a subdirectory like &lt;a href="https://yourdomain.com/Subdirectory/" rel="noopener noreferrer"&gt;https://yourdomain.com/Subdirectory/&lt;/a&gt;, it may break because the paths to assets and routes aren’t properly set up.&lt;/p&gt;

&lt;p&gt;You might see errors like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A blank screen when you visit the subdirectory&lt;/li&gt;
&lt;li&gt;Missing assets (CSS and JavaScript files not loading)&lt;/li&gt;
&lt;li&gt;Vue Router not working properly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s go step by step to fix these issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Set the Correct Base Path in Configuration Files&lt;/p&gt;

&lt;p&gt;Depending on whether you are using Vite or Vue CLI, you need to configure either vite.config.js or vue.config.js.&lt;/p&gt;

&lt;p&gt;For Vite (vite.config.js)&lt;/p&gt;

&lt;p&gt;Edit the vite.config.js file in the root of your Vue project and specify the correct base option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';

export default defineConfig({
  plugins: [vue()],
  base: '/subdirectory/', // Change 'subdirectory' to match your subdirectory name
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Vue CLI (vue.config.js)&lt;/p&gt;

&lt;p&gt;If you're using Vue CLI instead of Vite, create or edit vue.config.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  publicPath: '/subdirectory/', // Change 'subdirectory' to match your subdirectory name
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that all asset URLs are generated relative to the yoursubdirectory subdirectory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Configure Vue Router (If Used)&lt;/p&gt;

&lt;p&gt;If your project uses Vue Router, update the base option to match your subdirectory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';

const router = createRouter({
  history: createWebHistory('/subdirectory/'), // Ensure this matches your subdirectory
  routes: [
    { path: '/', component: Home },
    // other routes
  ],
});

export default router;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes sure the router knows that your app is not running at /, but at /subdirectory/.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Set Up .htaccess for Proper Routing&lt;/p&gt;

&lt;p&gt;If you’re using Apache, you need to configure an .htaccess file inside the yoursubdirectory folder to handle Vue’s history mode properly. Create a file named .htaccess and add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;
  RewriteEngine On
  RewriteBase /subdirectory/
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /subdirectory/index.html [L]
&amp;lt;/IfModule&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that all requests go to index.html, allowing Vue Router to handle navigation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Build and Deploy Your App&lt;/p&gt;

&lt;p&gt;Now that everything is configured, build your Vue app:&lt;/p&gt;

&lt;p&gt;For Vite:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vite build&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For Vue CLI:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm run build&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will generate a dist folder with your production-ready files. Upload the contents of the dist folder to public_html/subdirectory/ using FTP or your hosting’s file manager.&lt;/p&gt;

&lt;p&gt;Important: Don’t upload the dist folder itself—upload the files inside it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Clear Cache and Test&lt;/p&gt;

&lt;p&gt;After deployment, clear your browser cache or open the site in an incognito window to make sure everything loads properly. If you still see issues, check the browser console (F12 &amp;gt; Console) and the Network tab to see if any assets are failing to load.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Hosting a Vue.js app in a subdirectory of public_html requires proper configuration of the base path, Vue Router, and server settings. By following these steps, your app should now load properly under &lt;a href="https://yourdomain.com/subdirectory/" rel="noopener noreferrer"&gt;https://yourdomain.com/subdirectory/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you run into issues, double-check your vite.config.js or vue.config.js, router settings, and .htaccess file. Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to fixed search bar not working in windows 10</title>
      <dc:creator>colebidex2483</dc:creator>
      <pubDate>Wed, 31 Aug 2022 06:58:59 +0000</pubDate>
      <link>https://dev.to/colebidex2483/how-to-fixed-search-bar-not-working-in-windows-10-56ai</link>
      <guid>https://dev.to/colebidex2483/how-to-fixed-search-bar-not-working-in-windows-10-56ai</guid>
      <description>&lt;p&gt;Trying to solve this problem is easy, just follow the bellow steps&lt;br&gt;
Step 1: press window key + R on the keyboard for the run dialog box&lt;br&gt;
Step 2: in the run dialog box simply type in the following c: windows\system32\ ctfmon.exe and press enter and that is all. It should work now. Thanks&lt;/p&gt;

</description>
      <category>window10</category>
      <category>keyboard</category>
      <category>computer</category>
    </item>
  </channel>
</rss>
