Welcome to WebmasterWorld Guest from 54.163.100.58

Forum Moderators: Ocean10000 & incrediBILL & phranque

Please Help with rewrite.

   
7:07 pm on Feb 20, 2009 (gmt 0)

5+ Year Member



I am actually using the redirection plugin in Wordpress to do redirects, but after 2 hours fo searching the internet can not fix the regex to do what I need... any help would really be appreciated.

I need to redirect [mydomain...] to [mydomain...] (I just need to drop the resizeiframe.htm from any url)

Thank you to anyone who can help (without lambasting me for using a plugin instead of codding directly)

8:06 pm on Feb 20, 2009 (gmt 0)

5+ Year Member



Please help? I fI can just get the whole rewrite_mod code I can do it... Did I ask the question correctly?
8:12 pm on Feb 20, 2009 (gmt 0)

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



redirect+wordpress [google.com]

BTW, Welcome to Webmaster World.

8:20 pm on Feb 20, 2009 (gmt 0)

5+ Year Member



wilderness. Thanks. I looked there all morning. I have spent HOURS looking for this? I need an Apache htaccess redirect. Again, if you know the regex I would be really greatful!
8:21 pm on Feb 20, 2009 (gmt 0)

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Sorry.

Don't use Wordpress.

8:43 pm on Feb 20, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Try:

RedirectMatch 301 ^/([^/]+)+)/resizeiframe\.htm$ http://example.com/$1/

Note that this directive is a mod_alias directive, not mod_rewrite.

See the modules documentation at apache.org for more info.

Jim

[edited by: jdMorgan at 8:45 pm (utc) on Feb. 20, 2009]

3:02 am on Feb 21, 2009 (gmt 0)

5+ Year Member



Thank you so much for the response... I really apprecitate it... I put the statement in my .htaccess but it is not redirecting here is what it looks like...

# BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RedirectMatch 301 ^/([^/]+)+)/resizeiframe\.htm$ http://example.com/$1/

# END WordPress

I am sure that I am doing something dumb here, but could use a hand...

4:39 pm on Feb 21, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If you're already using mod_rewrite, then we'll have to use it for the new redirect as well, so as to guarantee correct execution order:

RewriteEngine on
RewriteBase /
#
# Externally redirect requests for "resizeiframe.htm" in any directory
# to the root of that same directory
RewriteRule ^([^/]+/)*)resizeiframe\.htm$ http://example.com/$1/ [R=301,L]
#
# BEGIN WordPress
# Internally rewrite any and all requests for non-blank URLs which do not
# resolve to an existing file or directory to the WordPress script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

If this does not work, then the definition of what requested URLs you want to redirect is wrong; Either your description is incorrect or incomplete, or I misinterpreted it, and so my RewriteRule pattern is incorrect.

I deleted the <IfModule> stuff. That is only meant to make the code fail silently on servers where mod_rewrite is not installed, and there is no need for it once the WP code is installed and working on your server.

Jim

5:11 pm on Feb 21, 2009 (gmt 0)

5+ Year Member



Jim,

Thanks a ton for the support...still not working. Here is teh .htaccess as it is on my site, now...

RewriteEngine on
RewriteBase /

#
# Externally redirect requests for "resizeIframe.htm" in any directory
# to the root of that same directory

RewriteRule ^([^/]+/)*)resizeIframe\.htm$ http://example.com/$1/ [R=301,L]

#
# BEGIN WordPress
# Internally rewrite any and all requests for non-blank URLs which do not
# resolve to an existing file or directory to the WordPress script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

In the event that I just not explaining myself well... here it goes again..

I want to redirect any url, this could be www.mydomain.com/category/resizeIframe.com or www.mydomain.com/category/pagename/resizeIframe.com or
www.mydomain.com/category/category/resizeIframe.com or
www.mydomain.com/category/category/pagename/resizeIframe.com

to EXACTLY the same url without the /resizeIframe.htm

Thanks, again for any help.

5:42 pm on Feb 21, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Which is it, exactly?
resizeIframe.com
resizeIframe.htm
or
resizeiframe.htm

The pattern must match exactly, and I see all three in this thread so far.

Otherwise, the code I posted does what you describe, as long as this code is located at example.com/.htaccess

Jim

6:26 pm on Feb 21, 2009 (gmt 0)

5+ Year Member



So sorry, resizeIframe.htm

fixed it... thanks!

7:52 am on Feb 23, 2009 (gmt 0)

5+ Year Member



try drupal or joomla
10:37 am on Feb 23, 2009 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Joomla is chock full of Duplicate Content issues.... for example, more than 8 URLs for the root homepage alone, before you even get into the site.
5:00 pm on Feb 23, 2009 (gmt 0)

5+ Year Member



Actually, so is WOrdpress, 5 URLs per post... but easy to set up so this doesnt happen...
 

Featured Threads

Hot Threads This Week

Hot Threads This Month