Tagged Questions
0
votes
1answer
40 views
Function to rewrite URl in Wordpress
I need to rewrte this URL http://example.com/news/?news_id=2 to http://example.com/news/2 where news is the page and 2 is the news_id
I have added following code in functions.php:
function ...
1
vote
0answers
58 views
Changing URL scheme, mod_rewrite not helping
We're trying to move away from the /YYYY/MM/DD/Post-Title URL structure without breaking links that are floating around on the internet. The mod_rewrite rule is fairly straight forward -
RewriteRule ...
2
votes
1answer
107 views
add new permalink structure from dynamic page
I created page "play" url: http://localhost/myweb/play and inside of page "play" I include PHP code to make the new search from outside Wordpress.
And all worked, if I search from my page "play" the ...
1
vote
2answers
71 views
a one-off rewrite rule
I have one page that I need to change the URL for.
Currently, the page resides at example.com/departments/human-resources/
(human-resources is a sub-page of /departments/ )
My client wants to ...
1
vote
1answer
140 views
ReWriteRules and WordPress Multi-Sites with Sub Directories
I'm having a diffucult time getting the ReWriteRules and URL structures setup for a Wordpress 3.4.2 (latest version as of this post) blog with multi-site enabled.
www.ourdomain.com/ is the homepage ...
0
votes
2answers
104 views
How do I make WordPress revise an .htaccess file a certain way?
I've learned just a slight bit with WordPress Rewrite API -- just enough to add another rewrite rule for a plugin. The plugin works if installed in the root, but I'm finding that if one installs ...
0
votes
1answer
428 views
how to create several url aliases for a page
on the root page of a WordPress site we have a custom page template, that also handles some forms and dynamically changes part of the content.
Something like this:
<form action="" ...
1
vote
0answers
85 views
Evaluating a external rewrite rule before internal wordpress rewrite rule
I am been plucking out my hairs since last few days trying to solve this problem:
I want to convert my urls from format
http://example.com/prodsearch/category/tag1-tag2-tag3-tag4
to
...
4
votes
1answer
166 views
How to remove dates from existing permalinks?
After doing some research about dates on blogs, it seems like it is a good idea to remove them from the existing posts.
Consider:
Self-hosted (on Bluehost)
Over 1,000 existing posts
All posts are ...
3
votes
1answer
130 views
Removing rules from .htaccess
I'm writing a small plugin that needs to write to .htaccess a simple non_wp_rule and i am doing it like this:
function ci_flush_rules()
{
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
...
0
votes
1answer
206 views
Why wp redirects me to wp-login.php when I visit a rewritten wp-admin URL?
I have this rewrite rule
^dashboard(.*) wp-admin$1 [L]
and wp redirects me to wp-login.php when I try to visit /dashboard (even if I am logged in)
Any idea why this happen, and how I can solve ...
1
vote
2answers
206 views
How to map permalinks with accented letters to sanitized slugs?
To keep legacy entries on a blog hosted on TypePad on sync with a new WordPress installation...
How do I map this permalink with accented letters:
domain.com/no-es-fácil-alejarse-de-la-política
to ...
0
votes
1answer
149 views
How to configure Multisite Network with randomized hostnames?
I'm trying to convert a freshly-installed and functional WordPress into a multisite network. But I'm having problems because of our Apache configuration.
We use Apache to randomly redirect requests ...
3
votes
1answer
150 views
Sub domain redirection to taxonomy
Hi all I want to use sub domain for my taxonomy like that :
http://taxonomy.domain.com/apple map to http://www.domain.com/taxonomy/apple
I add this to my vhost
RewriteCond %{HTTP_HOST} ...
0
votes
2answers
349 views
Rewrite Rules Are Redirecting and Not Passing VARs
I have the following code in my functions.php file.
<?php
add_action('init', 'flush_rewrite_rules');
function custom_add_rewrite_rules( $wp_rewrite ) {
$new_rules = array(
...
1
vote
1answer
790 views
Rewrite wp-login.php URLS to static pages?
I'm struggling with getting a few things in WP to redirect.
I'm using a front-end profile / profile editor, and I'm also using a front-end login/register.
Naturally I would like to redirect the ...
0
votes
2answers
220 views
modify URL with mod_rewrite or hook
i'm trying to achieve the following:
user enters this URL into browser
http://mydomain.com/boston/categoryname/postname/
i then want to get the first "folder" and check whether or not it's ...
0
votes
1answer
98 views
help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]
Possible Duplicate:
custom htaccess rewrite rule for page
ok i made another post and i got pointed to the Rewrite API
however, when i do print_r($_GET) on the page, it echos an empty array
...
1
vote
1answer
1k views
“.#[random-char-string]” being inserted at end of URLs
I've seen this on a couple of sites now and I'm having trouble finding information about (probably because it's awkward to describe):
All internal URLs like this for example:
...
0
votes
2answers
520 views
Why is home page content not displaying with this rewrite rule?
I am trying to pass a variable from a URL to PHP using mod_rewrite while maintaining standard WordPress functionality.
Here's my mod_rewrite rules:
RewriteEngine On
RewriteBase /
RewriteRule ...
0
votes
1answer
177 views
Modifying WP URL handing code?
I am trying to use mod_rewrite and modify WordPress' URL handling to allow for passing variables to PHP from the URL while maintaining "pretty permalink" functionality. (on WP 3.2.1)
Something like ...
5
votes
3answers
2k views
Masking wp-content/themes/name/images to just images directory using htaccess
I'm trying what I thought would be something really simple of masking my url but cannot seem to get it to work. I want to be able to link to images in my img tag without having to type in the full ...
0
votes
1answer
540 views
Rewrite rules for custom post type
There is a nonhierarchical custom post type "news".
/news/
/news/page/2/
/news/post_slug/
Each post has custom field "views". When someone opens post, field's value increased by one.
Would like ...
0
votes
3answers
621 views
Need to make a php file inside theme accessible via url
I checked this post here Making a plugin file accessible via url rewrite? which seems to have the same problem as me but its for a plugin. But so far i am getting 404.
add_action( 'init', ...
6
votes
1answer
4k views
How to create custom URL routes?
I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
0
votes
1answer
509 views
Can't get pretty permalinks to work without index.php
I've worked with WordPress for a while now and this is the first time I've had this problem, I can't get my permalinks to work without index.php on the URL even though mod_rewrite is enabled, a few ...
1
vote
1answer
341 views
Need help with simple rewrite rule (shouldn't this be easy?)
All I need is a rewrite that will change example.com/anyphrase into example.com.
Here is what I am using:
RewriteCond %{HTTP_HOST} ^example\.com
RewriteCond %{SCRIPT_FILENAME} !wp-admin
RewriteCond ...
0
votes
3answers
277 views
How to redirect a virtual page (e.g. /blog) to the home page?
I want my to reach my website's main page when entering an url like:
http://example.com/blog
However, I can't seem to get it to work with a typical rewrite rule:
RewriteRule ^/blog$ /
I'm always ...
0
votes
2answers
945 views
mod-rewrite exception? keep #hash in matching urls?
Hey guys,
My WordPress permalink structure is set to `/%postname%/.
When I create a page with a name "FAQs" the permalink generated is "mydomain.com/faqs".
When I link to this page in my code ...
0
votes
2answers
654 views
Why is my mod_rewrite not working?
Ok I have a WP site using the permalink structure of /%category%/%postname%/
I have built it in the way of page templates, using category queries inside, i.e.
page-help.php
<?php $my_query = new ...
-2
votes
1answer
194 views
Please give me the rewrite rules for my ugly urls
In functions.php I am adding a rewrite rule for this url:
http://www.myblog.com/?currentpage=1
http://www.myblog.com/?currentpage=2
And so on...
This is the code I use, can u please give me the ...
0
votes
1answer
2k views
Interesting Custom Post Type Slug with Taxonomy and Custom Field
I have created a custom post type called "events" and have also created a custom taxonomy which only shows up on this specific post type through which the admin must select an "event category" ...
1
vote
2answers
394 views
Using custom mod_rewrite without breaking wordpress permalinks
I am using a theme that uses posts for multiple pages, and the blog posts goes in a category called "blog", I am using the permalinks setting "/%postname%", and the blog menu url is "/category/blog", ...
2
votes
2answers
2k views
Making a plugin file accessible via url rewrite?
In my WordPress plugin I have a php file that generates some stats about the blog and outputs it as a simple text file. To access WordPress functions I've included this at the top of the file:
...