-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installed Wordpress in my YoURLS directory... now what? Excluding /blog/ somehow? #2108
Comments
It should work just with installing WP as usual in a subdirectory, ie :
|
@ozh I want the website itself to remain in http://jle.vi, as it is now, just the blog posts to go to /blog/. Do you know how I could possibly do this? Do I need to relocate the whole installation in order to do it and do some kind of redirect from root of jle.vi to jle.vi/blog or something? I wouldn't want the /blog/ in the URL for the main webpage, but if I had to, I'd live with it... Thanks |
You just need to do just as I said above |
Actually, this doesn't answer my question, because I still want the site to be hosted at jle.vi/, not jle.vi/site. I don't mind the BLOG posts to be at /site/, but the main site, I want to be at http://jle.vi/ If I do as you said, "[root]/.htaccess with YOURLS directive", then the whole site operates at jle.vi, and I don't know what happens when someone just goes to jle.vi without /site/ - know what I mean? Should I maybe post in the wordpress help forums...? |
Your I don't think you should ask here (maybe stackoverflow is better), NEITHER THIS IS A BUG. Just remember, WordPress doesn't have single post links only, it also have categories, tags, wp-json, feed and a lot more. But let's assume you just want
It may not work, and I don't recommend this practice. |
@phy25's solution won't work. You cannot have YOURLS and WP installed in the same directory. @entreprenewer I don't understand what you mean with "site", "blog", "main site", "whole site". I just don't understand what you're trying to achieve. |
Let me try to explain as clearly as I can. I want my website to function at http://jle.vi - without any additional subdirectory in the URL (such as /blog/ or /site/) However, in order to be useful, YoURLS needs to be installed in that root directory. I have thousands of links in there, and I'm not about to change them, plus, jle.vi/s/link is not a very useful short link, now is it? Right now, Wordpress is in the same directory as YoURLS... and it's working. But only because http://jle.vi is a one-page theme. As soon as I try to add the "blog" functionality of the theme, which links to other subdirectories (permalinks), then stuff breaks. I don't mind if all permalinks at at http://jle.vi/blog/link-name-here or something.. but as far as I understand it, if I move the Wordpress installation in it's entirety to http://jle.vi/blog/ or any other URL, then the site won't load when people go to http://jle.vi I guess part of what I'm asking is what happens if you JUST have YoURLS in a directory? What happens if people go to the root URL? What would happen if wordpress wasn't in there? I guess I would have to redirect to a subdirectory? |
Well, you already have the 2 answers to your problem:
|
@ozh your above statement...
Makes me wonder? I have an apache server with 65 WordPress domains across 8 multisite WP installs, all centered on one document root (directory). In addition, there was some hand coded websites and a couple forums, often sharing the same domain name and/or the same directory (URI) structure. Don't ask me why (started way back in 19-forgotten, before Google!). The point is that it worked by identifying the URI/directory structure differences. It seems to me it would be a simple thing to do the same with WordPress and YOURLS. In other words, I see no conflict with running the following together: http://vekind.org/ (WP - domain default page) and something like... This should be quite easy to do in Apache (and is what I am working on in Nginx). If you would like, I could load a basic site with WordPress and YOURLS in Apache and write some simple directions on how to run them both in the same document root. Perhaps just a slight change. If you think it would help others. Sincerely, Lan PS: I would also suggest giving YOURLS its own directory, configurable like WP does. This may allow more WP compatibility and make YOURLS multisite easier. |
WP's .htaccess : "when a file requested isn't a real file on the server (eg a .CSS or a .GIF) then redirect to index.php" So, basically, you cannot have WP and YOURLS in the same directory because they work the same way and then your htaccess would need to redirect to something that would first have to guess if a requested URL is a WP thing or YOURLS stuff. |
Yes, I agree with what you said about WP and YOURLS. However, that works in our favor. All one would need to do is to make a simple .htaccess file that would serve both programs. .htaccess has both regex and conditional statements. Just a quick overview of the way WP and YOURLS really works leads me to think there are many different regex that could be simply written to exploit the differences. All that we would need to do is find one thing that one program always does that the other didn't do and bingo... if (condition) {do index.php) else {do yourls-loader.php}. Just write that logic into .htaccess. Tell you what, I am traveling this week, but when I get back to the office next week, I will write the ,htaccess file for you. Do you want it for a single WP site with a Single Domain YOURLS, or a multisite WP? I will show you how easy it is to have YOURLS play nice with WP. Regards, Lan |
I am fully aware of how this can be done. You'll find several explanations in issues here or even "tutorials" on the web of people who needed it and toyed with the idea. This is just something I don't want to support because it has to be tailor made depending on each setup (ie your "if (condition)" will vary, some folks will restrict YOURLS URLs to 5 chars to segregate them from WP, others will do something else, and so on) and doesn't rely on YOURLS only. Anyway your solution to this problem is welcome as it may help searching for the same issue. Feel free to post your solution in a separate issue and answer it, Q&A style. |
Yes, I see your point. Basically, for a guy like me, who has been programming since back to the days of ARPANET at DARPA, "easy" is a relative term. I agree that ANY .htaccess setup needs to be extremely clear, similar to what WP or YOURLS now uses. Sort of "copy, paste, and change this to that!" (Like "Change example.com to your domain name.") "Restrict YOURLS URLs to 5 chars to segregate them from WP" That's an interesting idea I hadn't thought about. However, immediately I can see some serious flaws in this reasoning. 1. You'd run out of URL's before you reached a billion (a billion is really not that many if the site is open to the public). 2. I maintain a few hundred sites that have either "home" or "about" pages, or both. My guess is that those pages, or any other with a URI <6, would be sent to YOURLS (and crash in WordPress). A "five or less chars" limit might work for one guy publishing a single blog, but enforcing a greater than 5 chars WP rule on dozens (or thousands) of people will surely result in problems for some WP pages. 3. One additional problem I see is that a result of using WP in Multisite mode. So example.com, example.net, and example.org are going to be mapped to one single directory. Therefore, to a single .htaccess file. Assume YOURLS was only for the example.org domain, this five chars limit would send YOURLS some traffic (in error) from example.com and example.net also. I agree with you that this needs to be something simple, very simple, "copy paste simple!" I will work on a solution toward that end. I have two questions I did not see on your FAQs or that I want to make clear.
Regards and Thanks, Lan |
Answers:
|
Thanks ozh, your answers are very clear and specific - great support! 1) Give YOURLS Its Own Directory 2) YOURLS and WordPress Sharing the Root Directory 3) YOURLS and WordPress Multisite Sharing the Root Directory 4) YOURLS Multisite Each of these configurations is simple and easy to do at a novice or beginner's level. I will move this to my Lan Net Work site so my students can have a go at it, and test it. Will start a new thread with the finished hack or if we have any further questions. Thanks again for your great support Ozh! Best Regards, Lan |
You cannot, I tried different ways, maybe with new apache 2.4 using the set your website in a folder under root with a name e.g. "w", that means it will be at "sho.rt/w" then use this .htaccess
This will give you the option to still use sho.rt as your website address if the user doesn't pass any subfolder in the url, but if they do, it will check in yourls first and go to your folders if nothing found. One more thing, do not forget to add "w" in the $yourls_reserved_URL array in /user/config.php (Yourls config file) |
Technical details
Reproducible Bug Summary
This is a bug because I need to be able to link to blog posts, even if they aren't permalinks. It would be best if they were, and I could just exclude the /blog/ from rewrites, but I don't know how to do it.
I'm a pretty big novice, so I appreciate your patient and thorough explanation of what I need to do (for example, change a setting in Wordpress, add something to .htaccess, etc).
I don't want to move YoURLS, and obviously cannot move the entire site, unless, I guess, I redirect http://jle.vi/ to http://jle.vi/site or something like that and move the entire wordpress install.
Anyways, I attached the .htaccess file. Thanks for your help, everyone.
htaccess.txt
The text was updated successfully, but these errors were encountered: