.htaccess

Using .htaccess to change directory in url

倾然丶 夕夏残阳落幕 提交于 2020-01-13 18:23:46
问题 I am trying to change the url that is displayed in the address bar from mysite.com/blog/wedding-hair/ to mysite.com/services/wedding-hair/ using .htaccess. Using answers from: https://stackoverflow.com/questions/8713319/assigning-different-name-to-existing-folder-in-url-in-htaccess, rewrite a folder name using .htaccess, and Replace directory name in url with another name I added to the .htaccess file. Here is the .htaccess file, I added the last rewrite rule: Options -Indexes RewriteEngine

Using .htaccess to change directory in url

一笑奈何 提交于 2020-01-13 18:23:16
问题 I am trying to change the url that is displayed in the address bar from mysite.com/blog/wedding-hair/ to mysite.com/services/wedding-hair/ using .htaccess. Using answers from: https://stackoverflow.com/questions/8713319/assigning-different-name-to-existing-folder-in-url-in-htaccess, rewrite a folder name using .htaccess, and Replace directory name in url with another name I added to the .htaccess file. Here is the .htaccess file, I added the last rewrite rule: Options -Indexes RewriteEngine

Is it possible to use mod_rewrite htaccess to rewrite a url from name to id.

你离开我真会死。 提交于 2020-01-13 18:15:06
问题 If I have a URL http://www.domain.com/listing.php?company_id=1 is it possible for me to re-write that to http://www.domain.com/company-name by using that id to pull the name from the database. Or do I have to change listing.php to make it ?company_name=company-name If anyone can point me in the right direction that would be great. Thanks! 回答1: A map function allows using no id in the url at all, while still using the id in the rewritten url to do the database lookup. http://www.domain.com

.htaccess redirect https to http not working

谁都会走 提交于 2020-01-13 14:46:10
问题 I am trying to catch any https traffic to the front of my site so: https://www.domain.com is redirected to: http://www.domain.com However other subdomains need to be redirected elsewhere. For the most part this is all working, apart from the https -> http redirection. Here's my .htaccess file at the moment: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

.htaccess redirect https to http not working

六眼飞鱼酱① 提交于 2020-01-13 14:45:55
问题 I am trying to catch any https traffic to the front of my site so: https://www.domain.com is redirected to: http://www.domain.com However other subdomains need to be redirected elsewhere. For the most part this is all working, apart from the https -> http redirection. Here's my .htaccess file at the moment: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

.htaccess redirect https to http not working

流过昼夜 提交于 2020-01-13 14:45:44
问题 I am trying to catch any https traffic to the front of my site so: https://www.domain.com is redirected to: http://www.domain.com However other subdomains need to be redirected elsewhere. For the most part this is all working, apart from the https -> http redirection. Here's my .htaccess file at the moment: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

.htaccess redirect https to http not working

╄→гoц情女王★ 提交于 2020-01-13 14:45:05
问题 I am trying to catch any https traffic to the front of my site so: https://www.domain.com is redirected to: http://www.domain.com However other subdomains need to be redirected elsewhere. For the most part this is all working, apart from the https -> http redirection. Here's my .htaccess file at the moment: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

.htaccess mod-rewrite conflicting with subfolder auth

我们两清 提交于 2020-01-13 11:06:46
问题 I have a site which redirects all requests for files/folders which don't exist to an index file using .htaccess: RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule !admin/* index.php [NC,L] There is a folder "admin/" which has the following in .htaccess for auth: AuthType Basic AuthName "admin" AuthUserFile "/path/to/passwd" require valid-user Adding the auth .htaccess file in "admin/" causes

.htaccess file not redirecting http://www. to https://www

ぃ、小莉子 提交于 2020-01-13 10:42:10
问题 I have made a .htaccess file to redirect all website traffic to https://www. . This is my complete .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] The below redirects work exactly as expected: http://example.com -> https://www.example.com https://example.com -> https://www.example.com https://www.example.com -> https://www.example.com Except: http://www.example.com -> http://www.example.com As shown

htaccess rewrite index.php on root and subfolders

家住魔仙堡 提交于 2020-01-13 06:49:07
问题 I'm trying to redirect all requests to ./index.php?site=$1 while I only want to use the part behind the last slash. So I want www.mydomain.com/firstpage to become www.mydomain.com/index.php?site=firstpage and www.mydomain.com/subfolder/anotherpage to become www.mydomain.com/subfolder/index.php?site=anotherpage But right now www.mydomain.com/subfolder/anotherpage becomes www.mydomain.com/index.php?site=subfolder/anotherpage This is what I've got: RewriteEngine on Options +SymlinksIfOwnerMatch