.htaccess

How to enable php display_error on in my cPanel

 ̄綄美尐妖づ 提交于 2020-01-05 04:04:27
问题 I went through whatever is there and it showed me to add these two lines in my .htaccess file. php_flag display_errors on php_value error_reporting "E_ALL & ~E_STRICT & ~E_NOTICE" But then I get this error log message : Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration There is a very popular question in stackoverflow : here but there also it has been answered considering that the user has a local server. Here I am writing the php

Htaccess breaks css and javascripts

旧街凉风 提交于 2020-01-05 03:54:06
问题 RewriteRule ^([^/]*)/([^/]*)$ index.php?sayfa=$1&id=$2 [L] i have an htaccess code like this but it breaks css, javascripts and images. something happens like this sayfa = css id = style.css 回答1: I would suggest just checking if the file exists using a rewrite condition: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)/([^/]*)$ index.php?sayfa=$1&id=$2 [L] This essentially says, if the requested filename does not actually exist on disk and is not a

What is the meaning of ^ and $ in Apache HTTPD RewriteRule?

你离开我真会死。 提交于 2020-01-05 03:53:05
问题 I have successfully added the following code to my Apache HTTPD configuration: # Force www. RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] # Force https (SSL) RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Although it works as expected, I have a theoretical question: Why are there a ^ and $ in 3rd line enforcing "www.", and not in the 6th line enforcing "https"? Sincerely, Dovid. 回答1: For both of your regex

Change domain depending on url path

帅比萌擦擦* 提交于 2020-01-05 03:48:06
问题 I've got a multilingual website that works within different domains deppending on the language. All the domains share the same font code and the website (Drupal) determines the language using the path. Right now I've configured each domain to be redirected to its own language, so I've got: www.example.com -> www.example.com/en www.example.es -> www.example.es/es www.example.ru -> www.example.ru/ru This way, when an user enters the website the cms will switch the language to the one

Directory rewrite in .htaccess to another directory

自闭症网瘾萝莉.ら 提交于 2020-01-05 03:46:37
问题 I have .htaccess that does this: https://example.com/john shows the contents of the directory https://example.com/user/index.php?username=john RewriteRule ^([a-zA-Z0-9_-]+)$ /user/index.php?username=$1 [QSA] How can I make it so https://example.com/john/blah will show the contents of https://example.com/user/blah ? Only show contents of /user folder if my previous rewrite rule was applied. For example: example.com/john/haha ---> example.com/user/haha example.com/privacy/blah ---> // Will show

htaccess->show file if in cache directory, if not continue

别来无恙 提交于 2020-01-05 03:33:52
问题 Im playing arround with cache. What I want is the following logic: if ( file_exist(/cache/$request_uri.txt) ){ 1. show that file 2. Stop all rewrite actions, but perform other actions (like charset, error_pages) } else{ do whatever you normally do } Small example. I have the following files http://domain.com/example-123.htm (the requested page) http://domain.com/cache/example-123.htm.txt (the cache-version of that page) http://domain.com/someDir/example-456.htm (the requested page) http:/

htaccess->show file if in cache directory, if not continue

你离开我真会死。 提交于 2020-01-05 03:33:13
问题 Im playing arround with cache. What I want is the following logic: if ( file_exist(/cache/$request_uri.txt) ){ 1. show that file 2. Stop all rewrite actions, but perform other actions (like charset, error_pages) } else{ do whatever you normally do } Small example. I have the following files http://domain.com/example-123.htm (the requested page) http://domain.com/cache/example-123.htm.txt (the cache-version of that page) http://domain.com/someDir/example-456.htm (the requested page) http:/

RewriteCond file exists

房东的猫 提交于 2020-01-05 03:09:20
问题 Such a simple problem but htaccess and I have never got along. Serve the file if it exists. If the URI is just / and if index.html exists then serve index.html Otherwise serve app.php Here is .htaccess: # Disable the directory processing, Apache 2.4 DirectoryIndex disabled xxx RewriteEngine On # Serve existing files RewriteCond %{REQUEST_FILENAME} -f RewriteRule .? - [L] # For / serve index.html if it exists RewriteCond %{REQUEST_URI} ^/$ RewriteCond index.html -f RewriteRule .? index.html [L

url rewrite not working .htaccess

痴心易碎 提交于 2020-01-05 02:50:08
问题 I am trying to rewrite the url using htaccess and I have tried answers given on another questions here however nothing seems to be working at all I still get the original url. this is what I have: http://localhost/inbox.php?pg=2 I want http://localhost/inbox/2 I already had a rule that gets rid of the .php extension in .htaccess as below and just added the last line Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST

How to create friendly links in Yii project using Yiinitializr

纵然是瞬间 提交于 2020-01-05 02:30:14
问题 I try to use Yiinitializr site structure for my Yii project. The structure looks like this: root --backend ----standart yii folders ----... ----www ------index.php (admin.mysite.com) --common ----common folders for backend and frontend ----... --backend ----standart yii folders ----... ----www ------index.php (mysite.com) Blank Yiinitializr strucure see on github The question is how to make working URLs like this: admin.mysite.com/invites - in backend and mysite.com/users - in frontend