Tag Info

New answers tagged

0

In your subdirectory, open your access and change it to the stock setting. root/subfolder: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond. %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress That should work. ...


0

Found a solution for anyone who may stumble upon this. Basically, each part of a standard WordPress htaccess now has two RewriteConds: one for when it is in a subfolder, and another for when its not. Depending on that evaluation, the appropriate RewriteRule is applied. # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a ...


0

This is probably not very trivial to do. You need to take into account that wordpress needs the "forums" directory in the url to successfully detect that the requested content is forum post and not regular posts or pages. Therefor you need to change the value of REQUEST_URI in the htaccess file or add your own URL parsing code. the path of least resistance ...


0

Try this (untested): # BEGIN Forums Rewrite RewriteCond %{HTTP_HOST} !^www\.domain.com RewriteCond %{HTTP_HOST} ([^.]+)\.domain.com RewriteRule ^(.*)$ forums/%1 # END Forums Rewrite It should work with both your requirements. You don't need the second one (rewriting the forums folder to subdomain) because rewriting the actual forum ID will override the ...


1

Unfortunately no. The filename is hard-coded into the core WordPress function with no way to override it by way of filters or other hooks.


0

I think there is some issue with openshift's php hosting. I found this thread on stackoverflow. So catch is you append port no after host. This .htaccess code should work. RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule (.*) http://www.example.com:80/$1 [R=301,L]


0

As linked to above by @dougvdotcom RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]


0

With some help (also asked on SO, as this wasn't a strict WP question), and some testing, the following ended up working for me (added a slash just before the $ sign): RewriteRule ^galleries/(.*)/$ /portfolio/$1 [R=301,NC,L] As the galleries are actual directories, not files, they have a slash at the end: http://subdomain.example.com/galleries/headshots/ ...


4

This rewrite rule should work (assuming "brand" and "type" are the taxonomy registered names): function custom_rewrite_rules() { add_rewrite_rule('^brand/(.*)/type/(.*)?', 'index.php?brand=$matches[1]&type=$matches[2]', 'top'); } add_action('init', 'custom_rewrite_rules'); Remember to flush the rewirte rules after saving this code in your site. ...


1

When a URL is processed by Wordpress, its index.php script is loaded with the path to the requested page. Because in this case the index.php script is always found, a normal 404 error will never trigger (via ErrorDocument 404 …). If the requested URL does not match a page that WP knows about, WP will display its own "404" page. Unfortunately, if WP ...


0

You should be able to do it wih some JS utilizing the history API https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history It is supported enough to be used IMO but of course if your client insist on supporting IE6 you might need to find emulators of the API to use for older browsers. That said, my gut feeling is that your ...


0

The cause of your problems is this line: define( 'NOBLOGREDIRECT', 'http://www.ncc.my' ); If a user visits a blog that doesn't exist, e.g. http://example.ncc.my this is where the user is sent. However there are also sub directory installs, so all requests that aren't found are sent there. The easy fix would be to set up a page called 404 at ncc.my/404 ...


1

You cannot do this with redirect. Since, by definition, redirect sends browser off to a different location. You would need to map domain to an actual WordPress installation. It's not hard to have WP respond to different domain requests, however in your case it's complicated that you would need it to respond differently conditional on domain in request. I ...


0

Some DNS/hosting providers offer a "show in frame" option when creating a forward in their control panel.


1

Let me say beforehand that when using add_rewrite_rule() nothing is written to the htaccess file. Rewrite rules are stored in the database and handled by WordPress internally on PHP level. TL;DR: Rewrite rules do persist after plugin deletion, but probably not the way you'd expect it. When using add_rewrite_rule these rules are added in the options table ...


0

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install You have to COPY the index.php ot to the root and edit it to add the sub dir path.


0

In your htaccess add the following (before the WordPress rewrites): Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L] The above will make a permanent redirect from non-WWW to WWW. Alternatively you can do this in Google Webmaster Tools. Also, make sure that you ...



Top 50 recent answers are included