i need your help please, because of .htacces file, when i put it on the server i get the Internal Server Error and when i delet it i can see the website onligne, but with may problems of links, title of links become links .html and of course after following it page not found ( normal because, the real link it's mysite/offers.php?id=
and this is a copy of .htacces :
IndexIgnore */.??* *~ *# */HEADER* */README* */_vti*
php_value post_max_size 96M
php_value upload_max_filesize 96M
php_value max_execution_time 0
php_value memory_limit 96M
# Changement d'extension
RewriteCond %{HTTP_HOST} !^www.mysite.com$
RewriteRule ^(.*) http://www.mysite.com/$1 [QSA,L,R=301]
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName mysite.com
AuthUserFile /home/larbi/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/larbi/public_html/_vti_pvt/service.grp
RewriteEngine on
RewriteRule ^([0-9]+)-(.*)-.*$ offres.php?lang=$2&id=2_$1 [L]
RewriteRule ^prestations.php$ offres.php?id=2_1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /erreur_404.html
waiitng youe answer please, thank you so much
There's nothing wrong with your htaccess file but make sure of these things:
Make sure you have mod_rewrite enabled. It should be a line in httpd.conf that looks something like:
LoadModule rewrite_module modules/mod_rewrite.so
Make sure there's a file /erreur_404.html that exists, if that file is missing, the rewrite engine will loop.
Additionally, make sure /offres.php exists, if that file is is missing, the rewrite engine will redirect to /erreur_404.html.
Related
I need to redirect to the home page example (mysite.com) every time any user accesses any file or the uploads own directory that uploads directory has subdir year> month inside has image files I wanted the user to be redirected to the site home page without external images being broken
can anybody help me?
any help is welcome.
my actual .htacess file
RewriteEngine on
RewriteCond %{QUERY_STRING} (?:^|&)fbclid=
RewriteRule ^ / [L,R=permanent]
<IfModule mod_php4.c>
php_value engine off
</IfModule>
<IfModule mod_php5.c>
php_value engine off
</IfModule>
<Files ~ "\.((php[0-9]?)|p?html?|pl|sh|java|cpp|c|h|js|rc)$">
Order allow,deny
Deny from all
</Files>
try this ;)
For jpg,png,gif redirect
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://mysite,com/ .*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://mysite,com/.*$ [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://mysite,com/ [NC,R,L] // PAGE TO REDIRECT
<IfModule mod_php4.c>
php_value engine off
</IfModule>
<IfModule mod_php5.c>
php_value engine off
</IfModule>
<Files ~ "\.((php[0-9]?)|p?html?|pl|sh|java|cpp|c|h|js|rc)$">
Order allow,deny
Deny from all
</Files>
I Am Trying To Install A Kohana Based Script But I Am Getting A Error See Above In The Image
Error
And I Could Not Find What To Do But I Am Sue it Is Related To .Htaccess
SetEnv KOHANA_ENV development
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Disable directory listing
Options -Indexes
<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
# RewriteRule .* index.php/$0 [PT]
RewriteRule .* index.php [PT]
# Remove trailing slash
# RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L]
# RewriteRule ^(.+)/$ /$1 [R=301,L]
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.+)/$ $1 [L,R=301]
</IfModule>
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
according to script owner they said do step 3
Run the installer
Open .htaccess and make the following changes:
Set the correct RewriteBase
but i do not know what to write and what to edit in it i need a little bit help over it
The error means that the application, modules and system folders are not in the same directory as index.php. If you've moved /renamed them you need to change their location in index.php.
If you deleted/modified something by accident, try download Kohana again, obviously the error has nothing to do with .htaccess.
For more info, read the docs https://kohanaframework.org/3.3/guide/kohana/install
I am developing an application that's hosted on an apache server with PHP 5.
There is a website already running on the domain: www.domain.com. My application is on a folder called 'hotsite', and it can be accessed by the url www.domain.com/hotsite/.
The root folder contains a .htaccess containing:
/.htaccess:
XBitHack Off
RewriteEngine On
RewriteCond %{REQUEST_URI} \/([0-9a-z]{6})$ [NC]
RewriteRule ^(.*) http://www.domain.com/url/forward.php?%1 [L]
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.domain.com
AuthUserFile /home/intera/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/intera/public_html/_vti_pvt/service.grp
RedirectMatch permanent ^/webmail$ http://http://mail.google.com/hosted/domain.com www.domain.com/hotsite/
In this 'hotsite' folder, there's a .htaccess file containing the following code:
/hotsite/.htaccess:
RewriteEngine on
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ /folder/index.php
Now, when I access www.domain.com/hotsite/, my application loads fine. but when I try and access www.domain.com/hotsite/section/, it appears to ignore the .htaccess file and tries to access "section" as if it was a folder, returning a 404 error.
Any ideias why this is happening and what should I do to make it work?
Thanks =)
If the htaccess is inside the hotsite folder, then RewriteBase / needs to be RewriteBase /hotsite
Just in case; Note that the rewriterule, rewrites to /folder/index.php, and not /hotsite/folder/index.php
Just can't get rid of my url extensions.
I'm building a static site so all content is in HTML format and files have .html extensions.
I want to hide the .html extensions from users so my url would read websitename.com/about
I have modified the .htaccess file where my site is hosted, it now looks like this
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName boldfacedesign.co.uk
AuthUserFile /home/boldface/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/boldface/public_html/_vti_pvt/service.grp
RewriteBase /
RewriteEngine on
RewriteCond %{RQUEST_FILENAME} !-d
RewriteCond %{RQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1html [L,QSA]
At present this just isn't working.
As you can see this file is in the public_html folder, is that the correct place for it?
Or is there something else I need to do to enable the rewrite rule to take effect?
Or do I simply need to be patient and wait a day for the changes to take affect?
I've been googling this for hours now and I'm getting nowhere.
Not sure if these are typos or what, but your rewrite rules should probably look more like:
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [L,QSA]
Or if you have trailing slashes, the last line should be:
RewriteRule ^(.*?)/?$ $1.html [L,QSA]
I seem to be having an interesting problem in that .htaccess isn't routing to /public_html/index.html by default as it should, and I'm getting a page not found error. I do know that someone tampered with the file recently but have no idea what they did and I unfortunately know nothing about routing. I tried to do some research but didn't come up with anything that gave a solution to my predicament. Does anyone know how to go about making the server route to public_html? Here's what I have right now.
RewriteEngine on
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName evolvingwebcreations.com
#-------------------------
RewriteCond %{HTTP_HOST} ^swinkapps.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.swinkapps.com$
RewriteRule ^(.*) "http\:\/\/127\.0\.0\.1\:12005\/$1" [P,L]
#-------------------------
RewriteCond %{HTTP_HOST} ^swinkapps.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.swinkapps.com$
RewriteRule ^clients(.*) "http\:\/\/127\.0\.0\.1\:12005\/$1" [P,L]
Thanks in advance!
I don't believe it ever routes to public_html by default. You'll need to specify
UserDir public_html
and possibly set some access permissions such as
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>