.htaccess

Htaccess mod_rewrite blocking my css

吃可爱长大的小学妹 提交于 2020-03-05 06:58:08
问题 Got htaccess rewriting my links for better seo like this: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} .*/([^/]+)/? [NC] RewriteCond %{REQUEST_URI} !index\.php [NC] RewriteRule .* /index.php?cat=%1 [L,NC,QSA] which rewrites http://www.example.com/any/number/of/directories/lastDir to: http://www.example.com/index.php?cat=lastDir but my css isnt working, when i upload htaccess to the server, there is just plain text without images and css tried

Htaccess mod_rewrite blocking my css

放肆的年华 提交于 2020-03-05 06:58:07
问题 Got htaccess rewriting my links for better seo like this: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} .*/([^/]+)/? [NC] RewriteCond %{REQUEST_URI} !index\.php [NC] RewriteRule .* /index.php?cat=%1 [L,NC,QSA] which rewrites http://www.example.com/any/number/of/directories/lastDir to: http://www.example.com/index.php?cat=lastDir but my css isnt working, when i upload htaccess to the server, there is just plain text without images and css tried

How do I make parameters optional in my htaccess rewrite?

若如初见. 提交于 2020-03-05 02:06:45
问题 I want all of the following rewrites to be possible: https://website.com/CAT/api/translation/tasks/get/3/4x https://website.com/CAT/api/translation/tasks/get.php?param1=3&param2=4x https://website.com/CAT/api/glossary/folder/anotherfolder/put/6 https://website.com/CAT/api/glossary/folder/anotherfolder/put.php?param1=6 The first url works fine. However, I want the amount of parameters to be optional. If I remove a parameter: https://website.com/CAT/api/translation/tasks/get/3/ I get the error

How to redirect on **404.php** when bad URL is found? [closed]

三世轮回 提交于 2020-03-04 18:31:37
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 days ago . I have that in my .htaccess. ErrorDocument 404 https://my_site.com/404.php RewriteEngine on RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ view_page.php?id_page=$1 [QSA,L]

How to disable cgi in htaccess in a non-extension dependant way?

和自甴很熟 提交于 2020-03-02 04:53:28
问题 I would like to disable any kind of CGI execution in a directory below my document root directory. Any kind: php, perl, ruby... whatever. I would like to do it in a manner it's not depensant of the file extension. Below my document root because users have to be able to put and see HTML files. It has to be in htaccess, because it's a shared hosting. Using -ExecCGI alone is not working. I have to add to that line a AddHandler directive which is extension dependant. I have found some close

https to http 301 redirect via htaccess

柔情痞子 提交于 2020-02-29 04:35:10
问题 I'm trying to redirect all the https url to http. As my new server doesn't have ssl enabled. So Far I tried following but none of them worked.' RewriteCond %{HTTPS} off RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301] RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 回答1: Try : RewriteCond %{HTTPS} =on RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

Redirecting a page to the same page under a different domain

天涯浪子 提交于 2020-02-25 09:53:30
问题 I am changing domain names and want to set up a structure like so: If a user accesses www.olddomain.com/page , he will be re-directed to www.newdomain.com/page , etc. In other words, only the pre-slash part of the domain would change. I want to do this for all pages under the old domain. Does anyone know how I can configure this? 回答1: Can do this a number of ways in the htaccess file in the document root of your old domain . If the old and new domains are on different servers, or at least

.htaccess - won't add www to only one subdirectory

纵然是瞬间 提交于 2020-02-25 07:36:16
问题 I have a .htaccess in root directory, with this content: <IfModule mod_rewrite.c> RewriteEngine on #RewriteCond %{HTTP_HOST} ^domain.com #RewriteRule (.*) http://www.domain.com$1 [R=301,L] </IfModule> If I go to http://domain.com/subdir it rewrites to http://www.domain.com/subdir. But I have a problem with one subdirectory named "crm" - if I go to http://domain.com/crm it redirects me to http://www.domain.com instead of http://www.domain.com/crm. In this "crm" subdirectory I have another

.htaccess - won't add www to only one subdirectory

一曲冷凌霜 提交于 2020-02-25 07:34:46
问题 I have a .htaccess in root directory, with this content: <IfModule mod_rewrite.c> RewriteEngine on #RewriteCond %{HTTP_HOST} ^domain.com #RewriteRule (.*) http://www.domain.com$1 [R=301,L] </IfModule> If I go to http://domain.com/subdir it rewrites to http://www.domain.com/subdir. But I have a problem with one subdirectory named "crm" - if I go to http://domain.com/crm it redirects me to http://www.domain.com instead of http://www.domain.com/crm. In this "crm" subdirectory I have another

Disable Apache http2 announce via htaccess

霸气de小男生 提交于 2020-02-25 06:41:06
问题 I have a website on a shared host, responding with these HTTP headers on each page request: HTTP/1.1 200 OK Date: Thu, 21 Sep 2017 14:34:46 GMT Server: Apache X-Powered-By: PHP/5.6.31 Access-Control-Allow-Origin: * Upgrade: h2,h2c Connection: Upgrade, Keep-Alive Keep-Alive: timeout=5, max=400 Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 As you note, there is the Upgrade header that is an announce from Apache about the support of HTTP2 protocol. For some reason, I need to