Ok,
I have a small problem with .htaccess RewriteRule.
I made simple website locally that uses RewriteRule for urls like:
http://localhost/ <- main page
http://localhost/log/ <- log page
etc.
I have this in my .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /script
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
AuthUserFile c:\data\mysite\.htpasswd
AuthType Basic
AuthName "Secret place"
require valid-user
Since the site is ready and it’s basically just a helpful script, I move the contents to http://mysite/script/
It all works when I open http://mysite/script/, but when I click on an url, it opens http://mysite/script/log/ in browser bar, but loads http://mysite/ front page content.
Meaning, the redirect doesn’t let me read the necessaro log content but thinks it’s a rewrite to the front page ( since the main site doesn’t have a value script/log/.
Now, how can I set it to load the real mysite/script/log content?
Thanks in advance.
EDIT:
This is the .htaccess file on main site root:
RewriteEngine On
RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
RewriteRule .* - [F]
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule (.*) https://www.mysite.com/$1 [R=301,QSA,L]
RewriteCond %{QUERY_STRING} (\&ch_lang\=[]{2}|)
RewriteRule ^one-of-links$ ?main_page_extend=4011%1 [L]
php_value memory_limit 512M
You need to change the
RewriteBaseto/script. Otherwise when the rewrite to/index.phphappens, it goes to the document root’s index.php (your front page), instead of the one in script.