mod-rewrite

HTAccess rewrite dynamic page url

半城伤御伤魂 提交于 2020-01-05 12:12:49
问题 thanks for your help in advance Basically i have made a dynamic url website http://planet-dj-surrey.com/ I cant seem to figure out the code for the htaccess file to redirect a dynamic page and make it cleaner. for example i want http://planet-dj-surrey.com/index.php?page=designprocess to be changed to http://planet-dj-surrey.com/designprocess/ currently i have this but it does not seem to be working, RewriteEngine On RewriteRule ^/dropdownchoice/$ index.php?page=dropdownchoice [NC] Thanks in

.htaccess using escape quotes

扶醉桌前 提交于 2020-01-05 12:11:44
问题 I have this .htaccess: RewriteRule ^(aa.bbb|aaa,bbb|aaa-bbb|aaa_bbb||)/(.*)$ /index.html [L,NC] Will it be fine as above or should it be with espae quotes. I know in javascript is often \ in use. Like below: RewriteRule ^(aa\.bbb|aaa,bbb|aaa-bbb|aaa_bbb)/(.*)$ /index.html [L,NC] I need it for - _ , . all four of them. Do I need \ or some other sign in .htaccess and what is it. 回答1: From your rules only dot needs to be escaped (since that is special regex character) Two || should be removed

Using mod-rewrite to pass route to index.php

╄→尐↘猪︶ㄣ 提交于 2020-01-05 10:31:47
问题 I'm kind of new to mod_rewrite so I need some help from you guys. My folder structure is: assets/fonts/ Contains all fonts assets/images/ Contains all images assets/scripts/ Contains all JavaScript files assets/styles/ Contains all CSS files pages/ Contains parts of the page as PHP file or directory containing PHP files header.php Header of site footer.php Footer of site index.php index of site, now always loads pages/home.php. The pages directory contains all the body parts of the pages like

Using mod-rewrite to pass route to index.php

微笑、不失礼 提交于 2020-01-05 10:31:37
问题 I'm kind of new to mod_rewrite so I need some help from you guys. My folder structure is: assets/fonts/ Contains all fonts assets/images/ Contains all images assets/scripts/ Contains all JavaScript files assets/styles/ Contains all CSS files pages/ Contains parts of the page as PHP file or directory containing PHP files header.php Header of site footer.php Footer of site index.php index of site, now always loads pages/home.php. The pages directory contains all the body parts of the pages like

How to access the domain by custom name without changing actual url in next action

让人想犯罪 __ 提交于 2020-01-05 10:18:42
问题 Here is my website www.mywebsite.com/project But i want to aceess it by the name www.mywebsite.com/project/admin and www.mywebsite.com/project/user The content is inside the project folder. How can i do this ? Here is the .htaccess i already have <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %

rewrite URL from /index.php?page=about to /page/

你。 提交于 2020-01-05 09:36:55
问题 I'm sure this has been posted somewhere else but I can't find it. I have spent a few hours researching and trying everything I can thing of from sample code to generators. I have a site that is currently residing in a subfolder called "new". I will be moving the site to the root folder once it is ready for launch. The site is database driven and right now to access the pages you need to use a url like this: http://domain.com/new/index.php?page=about I would like to have it so the URL looks

force one page to use HTTPS and the others to use HTTP with .htaccess

妖精的绣舞 提交于 2020-01-05 09:30:50
问题 I am trying to force one page to always use https it is not working The url http://www.example.com/bookings/ and the .htaccess that I have RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^bookings$ https://www.example.com/bookings [L,R=301] 回答1: Try this rule as your very first rule in your root .htaccess : RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^bookings/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,NE,NC] 来源: https://stackoverflow.com/questions/27530010/force-one-page

APACHE mod_rewrite change variable name in query string

核能气质少年 提交于 2020-01-05 09:04:18
问题 I'm trying to change a variable name in a query string, so it's usable by my PHP code. The query gets posts from an external system, so I can't control that they are posting a variable name with a space in it. And that makes it impossible for me to use the PHP $_GET function. I need to change variable%20name to ?new1 And I need to change variable2 to new2 There are many variables passed in the query, but only these two need to be changed. The rest can stay the same or even disappear. So

APACHE mod_rewrite change variable name in query string

霸气de小男生 提交于 2020-01-05 09:02:29
问题 I'm trying to change a variable name in a query string, so it's usable by my PHP code. The query gets posts from an external system, so I can't control that they are posting a variable name with a space in it. And that makes it impossible for me to use the PHP $_GET function. I need to change variable%20name to ?new1 And I need to change variable2 to new2 There are many variables passed in the query, but only these two need to be changed. The rest can stay the same or even disappear. So

Apache / mod_rewrite / Periods messing with pattern

孤街浪徒 提交于 2020-01-05 08:06:55
问题 First question, here goes nothing... I'm trying to add a new entry to my .htaccess file (Apache server) with the hopes of translating this URL: http://platform.localhost/category.all into this URL: http://platform.localhost/index.php?page=category.all The RewriteRule that I'm currently using is this: RewriteRule ^([^/\.]+)\/?$ index.php?page=$1 This rule has worked fine for all URLs up until now, I can only assume that it is the period that is breaking it. What I'm trying to achieve is having