mod-rewrite

Multiple different php pages need to be friendly URL - url rewrite

别来无恙 提交于 2019-12-13 04:44:51
问题 I have php website has multiple different php pages: Example: http://www.mywebsite.com/post.php?group_id=10&post_id=1 http://www.mywebsite.com/image.php?group_id=10&img_id=1 http://www.mywebsite.com/poll.php?group_id=10&poll_id=1 http://www.mywebsite.com/group.php?group_id=10 http://www.mywebsite.com/user.php?uid=158 .... I need these URLs to be like the following: http://www.mywebsite.com/post/10/1 http://www.mywebsite.com/image/10/1 http://www.mywebsite.com/poll/10/1 http://www.mywebsite

.htaccess: RewriteRule: bad flag delimiters

本小妞迷上赌 提交于 2019-12-13 04:43:11
问题 Pulling my hair out over this one. I have the following .htaccess file that does some custom redirects in addition to Wordpress's default settings. When tested it on my local Wamp server it worked fine but after moving to production I'm not getting a RewriteRule: bad flag delimiters error in the server log and after a while the site even goes down with an internal server error Any help would be appreciated. Thanks in advance! <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule

Mod_Rewrite .Htaccess

孤街醉人 提交于 2019-12-13 04:39:33
问题 I have a problem which I could not find during my online search. I have successfully made a wildcard sub-domain and any sub domain to the main domain points to the folder. I am looking to create link URI to Parameters like 1- .domain.com/location/locationname to 2- .domain.com//location.php? locname= and then 1- .domain.com/location/locationname/category/categoryname/item/itemname to 2- .domain.com//orderitem.php?locname=locationname&ordercategory=categoryname&orderitem=itemname (2) is

wordpress .htaccess with permalinks

不羁岁月 提交于 2019-12-13 04:37:47
问题 I have a permalink working but as soon as I create a post it tells me that soory post not found permalink setting is to "/%pagename%/" and here is .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /ryan/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . ryan/index.php [L] </IfModule> # END WordPress 回答1: Try clearing the permalink setting in wp_options in the database and then reset permalinks in Wordpress. It's usually

how to modify this mod rewrite into the url I want?

核能气质少年 提交于 2019-12-13 04:36:01
问题 I actually got an answer that if I want to change my url from www.mydomain.com/laravel4/public/posts into www.mydomain.com/posts this is what I have to do with my .htaccess RewriteEngine On RewriteRule !^laravel4/public/ /laravel4/public%{REQUEST_URI} [L,NC] but I have another question if I want the url to be www.mydomain.com/laravel4/posts which takes out the public what should I modify? I thought taking out the laravel4 in the code above would work but doesn't seem that easy :( 回答1: Ideally

Sequence line of some files from differnt folders in order to rewrite in do it job in .htaccess file

天大地大妈咪最大 提交于 2019-12-13 04:35:52
问题 I have this: RewriteCond ONLY IF SOME FILES ARE REQUEST FIRST FROM FOLDER1 , THAN FROM FOLDER3, AND THAN FROM FOLDER3 (folder1|folder2|folder3) RewriteRule ^((?!/folder3/folder4/).*)$ /folder3/folder4/$1 [L,NC] If someone ask (browser) for some file in folder3 and before that any file wasn't requested from folder1 and folder2 than rewrite will not happen. If someone ask (browser) for some file in folder3 and before that some file have been requested from folder1 but NOT folder2 than there

Htaccess redirection exception

痞子三分冷 提交于 2019-12-13 04:35:39
问题 I have this rules in my htaccess in order to force https navigation: RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] But I want to add an exception for a page let's name it 'page.php' How can I do this? Thanks! 回答1: Just add a negative condition: RewriteCond %{REQUEST_URI} !/page\.php$ [NC] RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] RewriteCond %{REQUEST_URI} !/page\.php$ will exclude /page.php from this rule

SCRIPT_NAME and PHP_SELF with mod_rewrite in .conf

孤街醉人 提交于 2019-12-13 04:31:39
问题 After moving this mod_rewrite from .htaccess to apache2.conf both $_SERVER['SCRIPT_NAME'] and $_SERVER['PHP_SELF'] returns different values than else.. # point all requests to index.php RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteRule ^ /index.php [L,NS] example URL: http://domain.com/path/to/dir/ If the rewrite is in .htaccess then $_SERVER['PHP_SELF'] returns /index.php If the rewrite is in apache2.conf then $_SERVER['PHP

.htaccess change domain but keep path

萝らか妹 提交于 2019-12-13 04:29:29
问题 i don't even know whether this is possible or not. i've 3 domain names: mytest.com test88.com test99.com mytest.com is the main domain where all the content is located. in my case it is wordpress which is installed on that webspace. my htaccess looks like this: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)test88.com [nc] RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10&test=test88 [R,L] RewriteCond %{HTTP_HOST} ^(.*)test99.com [nc] RewriteRule ^(.*)$ http://%1mytest.com/wp/?page_id=10

Mod rewrite - make link readable

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:29:14
问题 Good morning! My homepage has the following structure: /index.php /pages/de/Home.php /pages/en/home.php ... The content is created dynamically with an ?id= The code therefore in index.php is: <?php if(isset($_GET[id]) AND isset($dateien[$_GET[id]])) { include $dateien[$_GET[id]]; } else { include $dateien[1]; }?> the array is defined as below. The chosen language is submitted by an ?lang= so a standard link looks like this: Index.php?id=1&lang&=1 . $dateien = array(); if ($lang==1) { $dateien