tags:

views:

75

answers:

1

Hello,

I am posting this question again because I didn't explain clear enough. Here are things that I need to achieve with the .htaccess file:

  1. Re-route /public_html/ to /public_html/myfolder/
  2. Make website/index.php?q=param to website/param/
  3. My php files are inside /public_html/myfolder/ and my image files are inside /public_html/myfolder/images/
Options -Indexes
RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
RewriteRule .* https://www.website.com/$1 [L,R=301]
RewriteRule ^$ myfolder/index.php   [L]


# Rewrite rules
<IfModule mod_rewrite.c>
  #RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ myfolder/index.php?q=$1 [L,QSA]
</IfModule>

The problem is, it redirects fine.. but I can't see any images! It doesn't seem to load my js, css, and etc..

This is the error I get:

1<br />
2<b>Notice</b>: Undefined property: stdClass::$component in <b>/home/website/mypage/includes/Template.class.php</b> on line <b>31</b><br />
+1  A: 

I would do something like this. I'm thinking the problem could be the order of the rules, that say, the first rule will try to load the image/js/css since isn't looking if the file exists.

try this:

Options -Indexes
RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
RewriteRule .* https://www.website.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ myfolder/index.php?q=$1 [L,QSA]
RewriteRule ^$ myfolder/index.php   [L]
Gabriel Sosa