Jump to content

[SOLVED] Works locally but not on host.


timmy0320

Recommended Posts

I contacted my host but maybe i can get a quicker response on here who knows. This works locally on my personal server but does not work right on my host maybe one of you knows why this is

 

########## NO INDEX VIEWS ALLOWED
Options -Indexes
Options +FollowSymLinks
########## DENY ACCESS TO .HTACCESS
<Files ".ht*">
Deny From All
</Files>
#ErrorDocument 404 /notfound/
########## REWRITE ENGINE ON
RewriteEngine on
RewriteBase /
########## REDIRECT TO MYDOMAIN.COM
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
RewriteRule (.*) http://mydomain.com/$1 [R=301,L]
########## IGNORE DIRECTORIES
RewriteRule ^images(/.*)?$ - [L]
RewriteRule ^css(/.*)?$ - [L]
########## REDIRECT FILES TO INDEX.PHP
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php [R=301,L]

 

 

When I go to my site mydomain.com/ my PHP script then explodes the '/' value into an array. For some reason when I put the .htaccess file on my host it doesn't work properly because it is sending me to mydomain.com/index.php in the URL itself (it does not do this on my local machine) instead of just leaving it as is so in turn I get an error not found (index.php) because it is not in my scripts array.

 

Any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/101028-solved-works-locally-but-not-on-host/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.