The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.

learn more… | top users | synonyms

11
votes
1answer
11k 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, ...
8
votes
3answers
4k 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 ...
6
votes
1answer
459 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 ...
4
votes
2answers
310 views

My permalinks are broken! Can I use mod_rewrite to ignore a physical file?

A website I work on recently posted a file at the root of their website named "2011.html." Now, any 2011 blog posts with the permalink structure of year/month/day/post-name do not work, and instead ...
3
votes
2answers
3k 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: ...
3
votes
2answers
2k views

mod_rewrite enabled but Permalinks show index.php

I just installed a friends blog on my LAMP stack, which has mod_rewrite enabled (I'm using it for clean URLs on my Drupal installs on the same server). For some reason, WordPress (3.0.3) isn't ...
3
votes
1answer
2k 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: ...
3
votes
2answers
1k views

Change author permalink

The original urls for users look like /author/login/ Is it possible to replace login by user's id? In my dream urls should become to /users/34/ (34 is user id). Thanks.
3
votes
1answer
87 views

Change permalinks for posts but not for custom post types

Currently my permalink structure for posts is domain.com/post-title I'm using a static front page and a "blog" page for posts. I'd like to to change the permalink structure for posts, tags and ...
3
votes
1answer
168 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(); } ...
3
votes
1answer
230 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} ...
3
votes
2answers
2k views

Clean URLs for custom $_GET variables

I have a query var show=othertemplate that I can add to any URL to show any post, page or archive in Wordpress in a different template, like this: mysite.com/[any URL]/?show=othertemplate. I'd like ...
3
votes
1answer
1k views

Wordpress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error [duplicate]

Possible Duplicate: WordPress upgrade now receiving Error 101 (net::ERR_CONNECTION_RESET): Unknown error We have just installed WordPress 3.0.1 and everything worked fine. However, as soon ...
2
votes
2answers
279 views

Can WordPress be installed at the root level, if a homepage called index.php already exists?

Can WordPress be installed at the root level, if a homepage called index.php already exists?
2
votes
1answer
2k views

404 when fetching image from wp-content/uploads/

I get 404 status when fetching images, and the http still contains that image. Image shows up in a browser, but the 404 code breaks some applications. calls to wp-content/uploads/ are redirected in ...
2
votes
1answer
833 views

How to rewrite WordPress uploads folder to another folder using htaccess

I found that the following code online could be used to spoof the WordPress uploads folder, rewriting URLs to a different folder on the server: # BEGIN Spoof wp-content/uploads directory ...
2
votes
1answer
342 views

Should I enable FastCGI on WordPress?

I am looking at my server settings and these are as follows: WebDav : active FastCGI : inactive SSL support : active Perl as Apache module : CGI-Programm PHP module : ...
2
votes
1answer
141 views

Using custom post type parent as slug

I'm currently using the plugin 'Types Custom Post Type' to create custom post types (I know it's pretty easily done through functions.php but I was feeling a bit lazy!). Basically, I'm looking to ...
2
votes
2answers
415 views

How to protect media directory with .htaccess?

I am trying to protect the uploads directory with .htacess. But when I browse media section in admin panel, I see user/pass popup. My guess is, WordPress use fopen to find if the file exists. I ...
2
votes
1answer
194 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
584 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", ...
1
vote
2answers
466 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 ...
1
vote
2answers
100 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
281 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 ...
1
vote
1answer
271 views

modrewrite not working on my Apache setup

Not sure if this is webmaster or a WordPress question, it's a bit half and half, sorry if I'm posting in the wrong place. Without using Multi-Site or installing new WordPress CMS' in second-level ...
1
vote
1answer
1k 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 ...
1
vote
1answer
411 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 ...
1
vote
1answer
57 views

Only default permalink is working mod_rewrite enabled

My problem is in my wordpress site only default permalinks is working.. When I change permalinks all pages become not found.. only home page is showing. When I change permalinks to postname .htaccess ...
1
vote
2answers
75 views

Why does Wordpress redirect when I separate wp-core and wp-content?

I'm trying to setup my Wordpress projects so that I can have http://www.example.com/ as my site URL, say mapped to /var/www/vhosts/www.example.com/ and in there, I would like to use the following ...
1
vote
2answers
146 views

Removing subcategories from permalinks

I run a small news site with tens of thousands of entries. I'm currently importing all of these into wordpress by rebuilding our old CMS into wordpress. So far, everything is coming over smoothly. ...
1
vote
1answer
502 views

mod_rewrite loop, redirecting http to https on certain section of wordpress blog

I'm trying to rewrite 3 sections of a wordpress site to https if they are accessed over http: /cart/ /my-account/ /checkout/ As well as these rewrite's worpress has added a rewrite to remove ...
1
vote
0answers
107 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 ...
1
vote
1answer
511 views

WordPress mod_rewrite is canceling/overwriting my other mod_rewrite rule

in /www/ I have an .htaccess file containing: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^([^.]*\.less)$ compilers/lessphp.php?file=$1 [R,QSA,L] ...
1
vote
0answers
85 views

I have a page using a pretty url and a mod_rewrite rule matching it. I expected it to give an error but it's working. Why?

this may seem like a weird question but I have something working and I don't understand how. I have moved my wordpress install to a subdirectory and am using the .htaccess file to redirect anything ...
1
vote
0answers
165 views

Some posts from custom post type to subdomains

I have custom post type where all posts associated with some persons. Like: mysite.com/masters/master-name/ And i need to have redirection from master-name.mysite.com. This redirection will be ...
1
vote
0answers
126 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 ...
1
vote
3answers
597 views

Wordpress home page showing 404 error

I've had a look for anyone experiencing the same issue but to no avail. I am currently working on a Wordpress site that previously did not have permalinks, so have added these (i.e. to change the ...
1
vote
2answers
149 views

mod_rewriting conflict with WP permalinks in htaccess [closed]

I need some help! I'm trying to rewrite this... localhost/blog/?c=var to-> localhost/blog/var But seems there is some problem... I get a 500 :( I also believe there is some conflict with 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" ...
0
votes
3answers
796 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', ...
0
votes
2answers
1k 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
1answer
185 views

Localize URL bases

I run a non-English blog. I love that WordPress has been translated to Spanish and currently I use the Spanish translated version of WordPress. One thing that I'd really like to change is the URL ...
0
votes
1answer
181 views

Use the category name instead of category slug in permalinks

How to create a permalink structure which finish by: /category-name/post-name/ Instead of: /category-slug/post-name/ By default, Wordpress is offering %category% tag strucure as "A sanitized ...
0
votes
2answers
161 views

Disable category RSS Feeds on Wordpress blog with PHP

I have a Wordpress powered site and I would like to know how to disable all category based RSS feeds with PHP or even mod-rewrite if possible. Thanks
0
votes
1answer
473 views

Can't get permalinks working!

I can't get WordPress pretty permalinks to work on my Fedora LAMP server. If I set them and click a page/post link I'll get a ""Oops! This link appears to be broken." The .htaccess file is writable ...
0
votes
2answers
881 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 ...
0
votes
1answer
181 views

Wordpress and Htaccess

Removing RewriteBase / from my htacess has sped up my site which is still working correctly. Is it really required and what is it for?
0
votes
1answer
54 views

Rewriting a date hierarchy into a 'yyyy-mm-dd' slug

I am building a magazine website with an issue custom post type. The slugs for each issue follow the format YYYY-MM-DD according to the issue's publish date. Currently the permalinks are set up as ...
0
votes
1answer
151 views

WP is ignoring .htaccess rewritten URL

I have two domains being served from the same WP install. edit: not multi-site In wp-config.php I have define('WP_SITEURL', "http://$hostname/wordpress"); etc. The two domains will have similar ...
0
votes
2answers
28 views

Access posts while mod_rewrite is broken

On my wordpress installation mod_rewrite (e.g. the permalinks) is temporarily broken. For debugging I want to access the formerly "prettified" page mydomain.tld/page/2. What is the old GET parameter ...