Skip to main content
Commonmark migration
Source Link

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

UPDATE

##UPDATE## Here'sHere's how my .htaccess file just now:

# 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

And with Liam Sorsby's answer, I tried pasting the code

RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L]

just below the # END WordPress once, and then tried again just before # END WordPress. But both time failed.

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

##UPDATE## Here's how my .htaccess file just now:

# 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

And with Liam Sorsby's answer, I tried pasting the code

RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L]

just below the # END WordPress once, and then tried again just before # END WordPress. But both time failed.

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

UPDATE

Here's how my .htaccess file just now:

# 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

And with Liam Sorsby's answer, I tried pasting the code

RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L]

just below the # END WordPress once, and then tried again just before # END WordPress. But both time failed.

Post Reopened by John Conde
added the whole question here + update
Source Link

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

##UPDATE## Here's how my .htaccess file just now:

# 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

And with Liam Sorsby's answer, I tried pasting the code

RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L]

just below the # END WordPress once, and then tried again just before # END WordPress. But both time failed.

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

##UPDATE## Here's how my .htaccess file just now:

# 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

And with Liam Sorsby's answer, I tried pasting the code

RewriteEngine on
RewriteRule ^([0-9]+)/([0-9]+)$ /date/$1/$2 [R=301,L]

just below the # END WordPress once, and then tried again just before # END WordPress. But both time failed.

added the whole question here
Source Link

I'd like to refer first toI asked the question in the main question in WPSE. TheWPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I mentioned howchanged my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I triedset a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess wayon my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

Can anybody figure me out a way on how to achievewith the desired result usinghelp of .htaccesshtaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

I'd like to refer first to the main question in WPSE. The answer I got so far is a complicated one. I mentioned how I tried the .htaccess way:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

Can anybody figure me out a way on how to achieve the desired result using .htaccess?

I asked the question in WPSE before, but the answer I got so far is a complicated one. I'm actually looking for a .htaccess way. Here's what the scenario is:

My blog archive URLs were like:

http://example.com/2014/03

I changed my site's permalink from /%postname%/ to /%postid%/%postname%/, and using Redirection plugin, I set a redirection like: redirection 1

and it's working. But the problem occurs in the archive URLs. The new archive URL generated with a /date/ basename before the dates, like:

http://example.com/date/2014/03

I'm trying to use the same Redirection plugin to redirect the URL, but failed: redirection 2

I then tried writing .htaccess on my own (with no .htaccess writing experience) with:

Redirect permanent http://example.com/([0-9]+)/([0-9]+) http://example.com/date/([0-9]+)/([0-9]+)

with the help of htaccess editor and this blog. But failed too.

How can I let my blog not to get 404 on such archive URL? I'm afraid, I'm dumb with rewrite rule till now. :(

Post Closed as "Not suitable for this site" by John Conde
Source Link
Loading