Rewrite rules modify a web URL's appearance. This modification is called URL rewriting. Rewritten URLs (sometimes known as short, fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of ...

learn more… | top users | synonyms

0
votes
0answers
8 views

How to combine 2 separate htaccess

I have 2 separate htaccess and i need to combine them into one but im not sure how to do it. These are my htaccess: 1 (the current one) <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
1
vote
1answer
19 views

Permalinks, Rewrites, Get Variables, Oh My!

Ok, so I know it's a silly title, but it's exactly how I feel right now.. I've created some custom rewrites for WordPress and they work great, the only problem is that now I need to add pagination. ...
0
votes
0answers
10 views

Exclude one specific slug from rewrite rule

I use the following rewrite rules to show a specific post of a custom post type in a category and all posts of a custom post type within a category: add_filter('rewrite_rules_array', ...
0
votes
1answer
16 views

Rewrite slug of custom post type to include post-id

My current permalink setting is /%postname%/%post_id%/. Would like to use the same with CPT. Currently the URL looks as site.com/questions/title/ Would like to get post id at the end of the url on ...
0
votes
0answers
17 views

Rewrite Rule Not Working

I am trying to use a rewrite rule to get 3 variables from the URL. Here is my rule: add_action( 'init', 'pe_rewrite' ); function pe_rewrite(){ add_rewrite_rule( ...
0
votes
1answer
38 views

404 when using pagination in a category

I always struggle with pagination in wordpress. I really wish that was a definitive guide to wordpress rewrite rules. I have a site setup this way: permalink custom structure: ...
0
votes
0answers
33 views

URL rewrite custom taxonomy using add_rewrite_rule() or generate_rewrite_rules()

I'm trying to get my head around amending some URL's for a website I have created. After reading two (very informative) answers (1, 2) but I'm still a little unsure how to approach creating a URL that ...
0
votes
0answers
30 views

How to Combine Two Custom Post Types into Single Permalink Structure

The website uses - A) A hierarcical Custom Post Type "Destination" to support the following structure, so each tier of the hierarchy could have its own unique destination guide: Territory - ...
0
votes
1answer
21 views

How do I reset a rewrite?

I made a mistake in writing a previous rewrite in .htaccess. How do I reset it? My home_url = http://basicsourcemassage.ca/bsmassage My site_url = domain name All pages work fine except for the ...
0
votes
0answers
12 views

Rewrites and Attachments

I'm currently working on a custom post type that has rewrite tags to allow for sub pages. e.g: showcases/project-name/media/ Media being the page. My problem is with attachments and media uploads, ...
0
votes
0answers
13 views

how to change some of the rules in the database

I need to add a rewrite rule for a WP page. I noticed that the rule is already part of the existing set, but apparently it is not correct. With the hope some internal mechanism would have replaced ...
0
votes
0answers
32 views

Help with add_rewrite_rule solution

In my Wordpress blog, I configured permalinks > Category base to "magazine" with links having this format: http://www.mydomain.com/magazine/news/europe/france The above link opens the France ...
0
votes
1answer
59 views

How to use wp rewrite to hide form action url?

I have a widget that I'm making that builds a multi-step form which retrieves xml data from a third party plugin (http://xmlplugin.com/geoquote.php). While this plugin is available for use already it ...
0
votes
1answer
17 views

Font Page overrides rewrites

I have a custom rewrite as follows So /shares points to a page I created with a slug images which uses a custom query variable named h626_page. My problem is I want to set the images page as ...
0
votes
2answers
24 views

Rewrite for page with a possible unknown parent page

I am trying to add a wp rewrite for my plugin that allows users to include a shortcode on a page that will then display a calendar. This calendar then requires url params in order to navigate the ...
0
votes
2answers
14 views

Rewrite the Wordpress URL from custom plugin

I have created a plugin in wordpress. I am making a cURL request to the server and server response is coming to new index.php. Which is in my_plugin/newfolder/newfolder/index.php. Now from the server ...
0
votes
0answers
19 views

Rewriting URLs with Query Strings

I've been (unsuccessfully) attempting to prettify some URLs in a website I'm building in Wordpress, from something like this - ...
0
votes
2answers
117 views

Custom post type child page 404

This issue seems to be quite common, but the solutions that worked for others haven't worked for me. I'm using the CPT UI plugin and have created a CPT called 'courses' with the following settings: ...
0
votes
1answer
48 views

Rewrite Endpoints and CPTs - How to use in a plugin

I'm working on rewrite rules for a plugin that uses a URL endpoint, /modifier, to create a query_var &modifier=1 to signify it should do something else. The rewrite deals with URLs where ...
0
votes
1answer
70 views

Using get_query_var() from a plugin

I'm trying to do a redirect feature in a plugin and i have an issue. First, the code: add_action( 'init', function(){ add_rewrite_rule( 'go/([^/]+)/?$', 'index.php?redirect_to=$matches[1]', 'top' ...
0
votes
1answer
36 views

.htaccess RewriteBase equivalent for WordPress - Passing a URL as a variable without getting a 404

I have a page ran by a javascript plugin that changes the url every time a slide in a gallery is cycled. This means that while slide 1 is visible, the URL is http://www.sitename.com/gallery/slide1/ ...
0
votes
0answers
25 views

URL rewriting with custom pagination

I'm using a custom query to display the results with the pagination and rewrite the URLs. The following function works fine and displays the URLs in following pattern: ...
0
votes
0answers
40 views

Wordpress permalinks on subfolder in iis7 not working

I have IIS 7.5. mod rewrite active. Currently, my wp site is inside subfolder. Here is web.config in my root folder : <rewrite> <rules> <rule name="site2.com" stopProcessing="true"> ...
0
votes
2answers
39 views

Redirect to a file in a WordPress theme directory

I have a site where http://mysite.com/wp-content/themes/mytheme/pdf.php creates a pdf of some content based on what's in a cookie. That URL is pretty ugly. I'd love the url to simply be ...
0
votes
1answer
61 views

Rewrite Rule for Post “Subpage”, with pagination

I would like to know if is possible to add a "subpage" to a post and in this "subpage" have paginated content, for example: I Have a Post Lorem Ipsum This post has Videos, Photos and Audios as ...
0
votes
0answers
15 views

Rewriting URLs with query strings and preserving them

straight to the issue - I MUST preserve link structure as follows, otherwise the baby squirrels die: website.com/blog.html?comments=%id% where the %id% stands for ID of post basicaly, that ...
0
votes
1answer
34 views

Why doesn't WP update my .htaccess file?

Before I begin, I do not have WordPress having permissions to update the .htaccess file. That's not what this is about. I'm full aware of that. My problem is WP generates the same file every time for ...
1
vote
0answers
44 views

Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)

I have a custom post type named "tours" and a custom taxonomy named "tour_type". "tour-type" taxonomy is hierarchical. In "tour-type" taxonomy, parent terms are limited to "eco-tours", "daily-tours", ...
0
votes
1answer
24 views

Change Admin URL

I changed my Wordpress directory structure quite a bit. Here's what I have: define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress'); define('WP_HOME', 'http://' . ...
0
votes
0answers
23 views

WP Rewrite Rules - insert custom rules

function rewriteRules() { add_filter( 'rewrite_rules_array', array( $this, 'my_insert_rewrite_rules')); add_filter( 'query_vars',array( $this, 'my_insert_query_vars')); ...
0
votes
0answers
22 views

URL-parameters and RewriteRule gives 404

In Wordpress I have a template (lets call it template.php) that has content on the following page: example.com/template This page should be able to handle URL-parameters like. I got this to work. ...
0
votes
1answer
41 views

How can I write a rewrite rule to appear to move a multisite?

As we concluded in my question about trying to change the url of a multisite the simplest solution might be to add a rewrite rule, since it is infact only the end result that I'm concerned about here. ...
0
votes
0answers
28 views

URL Rewrite for CPT single posts

I'm struggling with Wordpress' rewrite function I have the following URL structure http://example.com/album/test-7/ 'album' is the slug for the CPT single page 'test-7' is the slug for the CPT ...
0
votes
1answer
37 views

How to add a Rewrite Rule / Category Structure

I'm currently trying to use add_rewrite_rule() to create a rewrite (duh!), for a custom taxonomy page. I've added the rewrite tag "sort" with the following code: ...
0
votes
0answers
35 views

Why is my rewrite rule refreshing the page and removing my variables?

For some reason, the catch-all page rewrite rule is capturing this rewrite, rather than my own rewrite rule. My rewrite rule is listed at the top when doing a var_dump of the rules, as well as when ...
0
votes
1answer
76 views

Add Custom Values to Permalinks Through Custom Fields and Posts

I have two custom post types 1 called melon-parties and another called party-categories. for posts in melon-parties i create a metabox which gets populated from all posts from parties-categories. I ...
0
votes
1answer
122 views

WP Rewrite Rules - Custom post type & taxonomy

I've been beating my head against the wall for a few days trying to figure this out. I have a custom post type and custom taxonomy and I'm trying to get my URL's to work. Here is the URL structure ...
0
votes
1answer
36 views

rewriting for custom taxonomy rewrite

I want to rewrite my custom taxonomy in form of http://mywebsite.com/cars/my-tax All examples i found makes use rewrites and use a new function to get the new permalink... problem is normally to get ...
0
votes
3answers
56 views

How to flush rewrite rules on the activation of any plugin

I created a function in functions.php that adds some rewrite rules: function add_rewrite_rules() { add_rewrite_rule('events/page/([0-9])*/?', 'index.php?pagename=events&paged=$matches[1]', ...
0
votes
1answer
40 views

Custom URL scheme - paramters on custom post type

I have a custom post type set up as Event. Within this post type I have various bit's of content / custom meta which will be used on two or three different pages. I was wondering lets say I had my ...
0
votes
0answers
30 views

Unable to manipulate rewrite rules without calling flush_rewrite_rules() each time

I am trying to make a small portfolio website in multiple languages. Just a few pages (the actual blog doesn't need to be in multiple languages), mainly pages that are generated by a own-made plugin. ...
0
votes
0answers
34 views

Permalink clashing with Custom Post Type rewrite rule

I have created a custom post type called 'members' which works correctly. I have set the rewrite rule to... 'rewrite' => array('slug' => 'our-members'), I have then added some items to this ...
0
votes
0answers
168 views

Nginx rules for multi-site with fixed alias slugs

I had a working WP 3.5 site on apache2. We're moving to a new server and using Nginx. I have updated the files to WP 3.9 (latest current). Accessing /wordpress/ directly lets me see the master ...
0
votes
1answer
71 views

WordPress site displaying 404 for any page apart from index

My WordPress site is returning a 404 not found error on any page apart from the homepage and /wp-admin. I have no absolutely no idea why this is. My Permalinks are set up to use ...
0
votes
1answer
45 views

Sort loop with query in the link

I want to add some buttons that will sort the post by name asc/desc etc. I want to use query in the link like this http://domain.tld/?orderby=name&order=asc Is this safe to use? Are there ...
2
votes
1answer
249 views

Change the Permalink for wordpress attachment

My attachments are currently rewritten from http://localhost/?attachment_id=3 to http://localhost/images/image-title using @Bainternet's answer here. $new_rules['images/(\d*)$'] = ...
1
vote
1answer
302 views

How to add custom rewrite rule to .htaccess?

I want to add a custom rewrite rule to my .htaccess file using a function inside functions.php The rewrite rule I want to add is as follows: RedirectMatch 301 ^/author/(.+)$ http://name-blog.com/$1 ...
1
vote
1answer
36 views

Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?

I am using custom urls for my author pages like this: http://site.com/author_name After I create a new user, that author page appears as not found; however, if I update my permalink structure from ...
0
votes
0answers
78 views

ReWrite Permalink to New Permalink Nginx

I used to have /%postname%/ permalink but something odd happened today, all links that I click suddenly redirect to home. So I changed the Permalink to /%category%/%postname%/ but this is a big ...
0
votes
0answers
15 views

Custom Taxonomy rewrite url

How to redirect a url from example.com/taxonomy/taxvalue/?spost=holiday to example.com/index.php?post_type=holiday&taxnomy=taxvalue Code: function custom_post_rewrite_rules( $rules ) { ...