The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
htaccess rewrite issue
I am trying to do some rewrites and finally trying to master htaccess but nothing seems to be working for me.
To start I need to send everything under the top listed forum to the bottom one. PHP Code:
PHP Code:
Thanks, Rich |
#2
|
||||
|
||||
Code:
Options +FollowSymLinks RewriteEngine On RedirectMatch 301 ^/([A-Za-z0-9-]+)-([0-9]+)/$ http://musclemecca.com/forums/$2-$1 |
Благодарность от: | ||
RichieBoy67 |
#3
|
||||
|
||||
Thank you very much. It appears as if I was not even close. The first one was a mixture of a tool I had used and my own edits and the second one I wrote myself.
After looking at your code I am very lost. --------------- Added 15 Jan 2014 at 05:28 --------------- # - Update Doesn't seem to work - I believe due to the current rewrite rules already on my htaccess, some of which are not working either. PHP Code:
Rich |
#4
|
||||
|
||||
Wait little time, i write for you some rulers for writing htaccess
I am russian and it's hard to formulate |
#5
|
||||
|
||||
That would be amazing! Thank you very much for your help and no need to rush.
I understand some of the rules but putting them together is tough for me. I have been working on learning this so your help is greatly appreciated. |
#6
|
||||
|
||||
1
Root htaccess should be as short as possible and so that there were fewer rules as Any rules slow down the speed of opening a website. 2 Try to use Redirect and RedirectMatch. In particular, RewriteRULE load slow down the site 3 Very great importance sequence of rules. Example read 1 line, there is a match - execute, no: read a line 2 read 2 line, there is a match - execute, no: read a line 3 etc RewriteRULE performed primarily from any row 4 Divide your htaccess into several parts For example: If you have two or more lines that comply with the rules of redirects in site.com/TAGS/ Create a folder on the server TAGS And put new htaccess with redirects in this folder 5 Images. Create a subdomain IMAGE and drag it all the images. it's make "parallel loading" of images, and accelerate the discovery of page At the root of the subdomain images.site.com create htaccess with all settings for images Sorry for my bad english ))) |
Благодарность от: | ||
RichieBoy67 |
#7
|
||||
|
||||
Thanks Ikopylov! That was really helpful. I did not even think of #4 to solve some of the issues I am having! Nice and simple.
Really appreciated it, Rich BTW - Your english is better than many people I know who speak English as a primary language. |
2 благодарности(ей) от: | ||
CAG CheechDogg, ikopylov |
#8
|
||||
|
||||
At you htaccess (post #3) you write 28 lines of ReWriteRule, which operate in media folder ( www.site.com/media/ )
Del this lines in root htaccess. Create new file: www.site.com/media/.htaccess with this 28 lines |
#9
|
||||
|
||||
Thanks
Yes, that makes sense with the media folder. I will do that definitely. The problem I am having though mainly is with the urls that do not have folders and no longer exist such as Code:
/bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a- 220802/index2.html to http://musclemecca.com/threads/220802-***Official-Mecca-Top-6-Guess-rules-amp-standings- thread***-2013?highlight=rules+standings What is confusing me is that this url is a thread under a forum but it is not using the forum directory. Trying to write rule to redirect all past urls under a certain forum to the new forum they were moved too. Thanks again. I am learning slowly. |
Благодарность от: | ||
CAG CheechDogg |
#10
|
||||
|
||||
Quote:
appeal attention ?highlight=rules+standings ---------------------- vBseo remove this symbols^ "***" these characters are not in the old *** link Therefore, if the redirect server can not find their match That's the only way how you can make a redirect : Code:
Options +FollowSymLinks RewriteEngine On Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802/index2.html http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013/page2 Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802/index3.html http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013/page3 Redirect 301 /bodybuilding-discussion-news-226/official-mecca-top-6-guess-rules-standings-thread-2013-a-220802 http://musclemecca.com/threads/220802-***official-mecca-top-6-guess-rules-amp-standings-thread***-2013 therefore, this is the only option as you can make a redirect --------------------------- There is another option, but it's a bad idea to implement. Code:
RedirectMatch 301 ^/([a-z-]+)-([0-9]+)/([a-z0-9-]+)-([0-9]+)$ http://musclemecca.com/threads/$4 Execution sequence for example: RedirectMatch old thread+post => new thread+post RedirectMatch old thread+pool => new thread+pool RedirectMatch old thread => new thread RedirectMatch my bad kod => you bad thread Short link will be used: http://musclemecca.com/threads/220802 This is good for the user, it gets to the desired page, but bad for search engine: it will be a duplicate page. --------------------------- It's important: Do not forget that Unix understands this: Letter letter As two different words. In windows it as one word |
Благодарность от: | ||
RichieBoy67 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|