.htaccess

Redirect to dynamic relative paths with .htaccess?

人盡茶涼 提交于 2021-01-22 10:38:15
问题 Is it possible to make .htaccess "understand" dynamic relative paths and redirect to them properly? My setup goes as follows: http://domain.com/htroot/aaa/xyz http://domain.com/htroot/bbb/xyz http://domain.com/htroot/ccc/xyz And so on. For the sake of the example, "htroot" contains the .htaccess I need to modify. The following sublevels (aaa, bbb, ccc) can be any a-z0-9 name, and the folders have an index.php (or any other .php to be redirected to). The xyz should work as a parameter of sorts

The requested URL was not found on this server

时间秒杀一切 提交于 2021-01-21 05:51:31
问题 While hosting a codeigniter website on my server, the first page is coming through fine and the other links are showing an error as shown below. Not Found The requested URL /site/ourservices was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. How to sort this out? I am a beginner. 回答1: Add these lines to .htaccess : (based on codeigniter urls docs) RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f

Changing query string key name with htaccess rewrite rule

烈酒焚心 提交于 2021-01-20 13:15:09
问题 We are changing affiliate software and I can't figure out how to rewrite the name of the query string key to achieve the following: https://www.example.com/path/to/productx?old_key_name=numeric_value Redirect to: https://www.example.com/path/to/productx?new_key_name=numeric_value So far I have: RewriteCond %{QUERY_STRING} ^old_key_name=([0-9]+) RewriteRule ^ %{REQUEST_URI}?new_key_name=%1 [L,R=301] Which doesn't retain the full path to the product, but results in: https://www.example.com

How to run laravel in root directory without the public folder?

狂风中的少年 提交于 2021-01-20 13:06:23
问题 I am running the latest version of laravel on my own server running Debian and Apache2 . The contents of laravel are located in /var/www which is what my domain name is pointed to however all of the functionality happens through the public directory so I would have to go to http://mydomain.com/public to access anything. I would like to change it so that I only have to access http://mydomain.com . Is this possible? How can I change this? Would I have to move everything up another level to the

How to run laravel in root directory without the public folder?

笑着哭i 提交于 2021-01-20 13:05:10
问题 I am running the latest version of laravel on my own server running Debian and Apache2 . The contents of laravel are located in /var/www which is what my domain name is pointed to however all of the functionality happens through the public directory so I would have to go to http://mydomain.com/public to access anything. I would like to change it so that I only have to access http://mydomain.com . Is this possible? How can I change this? Would I have to move everything up another level to the

How can client side JavaScript send a user id/password to an Apache server so that a folder protected by .htpasswd is unlocked?

◇◆丶佛笑我妖孽 提交于 2021-01-07 02:35:37
问题 I would like to give access to files in a folder to users that login to a web app that I made. The users login by entering an ID and a password that is checked against a database that is accessible using an API. Once they are authenticated they can use the web app but I would also like to give them access to files in a folder on the web server. The web server is running Apache and is separate from the API server. I would rather not build a server side password authentication app but instead

How can client side JavaScript send a user id/password to an Apache server so that a folder protected by .htpasswd is unlocked?

限于喜欢 提交于 2021-01-07 02:35:27
问题 I would like to give access to files in a folder to users that login to a web app that I made. The users login by entering an ID and a password that is checked against a database that is accessible using an API. Once they are authenticated they can use the web app but I would also like to give them access to files in a folder on the web server. The web server is running Apache and is separate from the API server. I would rather not build a server side password authentication app but instead

SSL .htaccess - Simple Q

[亡魂溺海] 提交于 2021-01-05 13:19:51
问题 I truly hate this file... I just spent 6.5 hours trying to figure this out and with my ADHD dyslexia it's just impossible!! I have a domain that I bought for SSL for (currently I Have to wait for the ssl for WWW to kick in but for now the domain without WWW works, for example: https://tomas.com The .htaccess I have in root is currently: RewriteEngine On RewriteCond %{HTTP_HOST} tomas\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://tomas.com/$1 [R,L] And the code above does

Redirect 301 with regular expresions to other url with similar numeration

我的梦境 提交于 2021-01-05 08:58:19
问题 I migrated my articles in website, and the CMS system transform de URLs. I need to redirect URLs similar to: Example, Case 1. Same article name and diferent number at the end of URL: Original URL: https://www.website.com/folder/2087-name-of-the-article Source URL https://www.website.com/folder/name-of-the-article-r929/ Example, Case 2. Same article name and diferent number at the end of URL, but with other subfolder: Original URL: https://www.website.com/folder/2087-name-of-the-article Source

htacces 2 variables issues

南笙酒味 提交于 2021-01-04 05:41:09
问题 BEFORE I installed SSL things were working perfectly!! Here is the code I have in my root webserver .htaccess file: Options +MultiViews RewriteEngine On RewriteCond %{HTTP_HOST} andrea\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://andrea.com/$1 [R,L] RewriteCond %{DOCUMENT_ROOT}/$1.php -f RewriteRule (.*) $1.php [L] It works and it does exactly what I want it to do. So if I go to for example: www.andrea.com/account it accesses "www.andrea.com/account.php". Which is what I