Home > Enterprise >  I'm getting jquery issue after writing .htacess
I'm getting jquery issue after writing .htacess

Time:01-09

I'm writing .htaccess for my website. But after writing .htaccess for some pages, I found that redirection is working but css and jquery is not loading properly. I'm trying in localhost (xampp). Can somebody help me getting out from it.

This is my .htaccess file code.

RewriteBase /raman/

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*) index.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d



RewriteRule ^newdashboard$ dashboard.php

RewriteRule ^createbook/(.*)$ create_book.php?creatbookfailed=$1

Now, for example, I want to go the create_book.php page, then, it will redirect me to the createbook page but the css and jquery is not loading and giving errors. you can see the errors in the screenshot attached.

Jquery Errors

I removed the .htaccess and then, run with the original path (create_book.php?creatbookfailed=pathmessage). Jquery is working fine.

Can somebody help me to find out what am I doing wrong here. Or need some more explanation which I missed now, please let me know

CodePudding user response:

I forget to add the base url in my header file . After adding base url in header file (inside head tag), everything is working fine.

<base href="https://www.yourbaseurl.com">

Thank you for your answer @Teemu

  • Related