1

I have an htaccess file and it has the following code. I am running my project on local system. Whenever I Open http://localhost/jobseeker/ it opens it but the css and js files are not implemented. When i checked their paths, it shows, http://localhost/assets/css/font-awesome.min.css instead of http://localhost/jobseeker/assets/css/font-awesome.min.css. Plz let me know how i can solve this.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [QSA,L]
</IfModule>

# BAN USER BY IP
<Limit GET POST>
order allow,deny
allow from all
deny from 123.63.30.165
</Limit>
4
  • 1
    Did you close the <IfModule> container? Commented Jun 30, 2015 at 6:27
  • Yes, but nothing happened. I had also edited that in the question @pokeybit Commented Jun 30, 2015 at 6:29
  • Remove / from RewriteRule . /index.php Commented Jun 30, 2015 at 6:30
  • Nothing happened @pokeybit Commented Jun 30, 2015 at 6:33

1 Answer 1

1

Try changing your /jobseeker/.htaccess with this:

RewriteEngine On
RewriteBase /jobseeker/

RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

Also add this rule in DocumentRoot/.htaccess:

RewriteEngine On

RewriteRule ^(assets/.*)$ /jobseeker/$1 [L,NC,R=301]
Sign up to request clarification or add additional context in comments.

9 Comments

I put the above code in .htaccess but I didn't get where to find DocumentRoot/.htaccess @anubhava
Sorry, but I am not getting it. @anubhava
I just want to know where to add RewriteRule ^(assets/.*)$ /jobseeker/$1 [L,NC,R=301] line
If .htaccess file doesn't exist in parent directory of jobseeker then you will need to create a new one.
I did that but the results are still the same.
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.