Jump to content

Mod_Rewrite help?

Featured Replies

Posted

Hello, I just upgraded to 4.1 from 3.4.  The URLs for my articles appear to be broken.

My old url structure was site_url/_/article_category/article_title

My new url structure is site_url/articles/article_category/article_title

I have already put in a ticket, but IPS has determined that helping me with this is outside of their scope of support.

I've added this line to my .htaccess, but it doesn't seem to be helping.

RewriteRule ^_/$ /articles/? [L,R=301]

Here is the full text of my Mod_Rewrite

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^page/index.html/(.*)$ https://www.cheersandgears.com/$1 [R=301,L]
RewriteBase /
RewriteRule ^_/$ /articles/? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) - [L,NC,R=404]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteCond %{HTTP_HOST} ^cheersandgears\.autohosts\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.cheersandgears\.autohosts\.net$
RewriteRule ^/?$ "http\:\/\/192\.157\.233\.68\/" [R=301,L]
</IfModule>

 

 

Try this

rewriterule ^_/article_category/article_title (.*)$ https://www.cheersandgears.com/articles/article_category/article_title $1 [r=301,nc]

 

  • Author

thanks, I had to modify what you put because you left the placeholders in, but I got the idea of what you were trying to say and it didn't work.

try redirect

//301 Redirect Entire Directory
RedirectMatch 301 https://www.cheersandgears.com/_/article_category/article_title (.*) https://www.cheersandgears.com/articles/article_category/article_title /$1

 

  • Author

This ended up being the answer

RewriteRule ^_/(.*)$ http://www.cheersandgears.com/articles/$1 [R=301,L]
 

Are articles the only database that ever saw the light of live? If so, the above is fine. if not... you might want to add the following as an additional processing rule after that one.

RewriteRule ^(.*)/_/(.*)$ http://www.cheersandgears.com/$1/$2 [R=301,L]

So that other database records properly redirect.

  • Author

Yes, the only database I had live was the articles one.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.