Parse url like wordpress /year/month/post_id - wordpress

I am building my own frontend interface to my wordpress site.
What I cannot solve is how to show friendly url like wordpress does.
I want go from this:
designals.net/demo/index.php?id=BACARDI
to this:
designals.net/demo/2014/04/BACARDI
Should I use .htaccess?
Thanks you very much in advance!!
EDIT: I am building my frontend from scratch (querying from database using my own php code), so wordpress settings may not take effects on my site, I need to match url rules of boths sides.

Go to Settings -> Permalinks, and change it to the "Day and Name" option.

Yes you need to use .htaccess. Go to Settings->permalinks and change the settings there

Related

Permalinks wordpress without Rewrite module

I would like to use permalinks to change the url of the pages of my wordpress but my actual hosting doesn't allow me to activate an Apache module.
Is there a way to change the permalinks style without Rewrite module?
Thanks in advance.
Well as #doublesharp said there isn't a way to do it.
If someone needs something similar this is what I finally did:
Set custom structure in your Permalink Settings and put this:
/index.php/%postname%/
This will create an structure like this:
http://youdomain.com/index.php/postname

Wordpress network site URL handling

I have a szenario I don't know how to solve.
I have installed a MU Wordpress site.
First problem - site path
I have two sites "www.powerdoo.com" (site1) and "www.powerdoo.com/de-de" (site2).
But I want that my main site also has default path, so the result should be "www.powerdoo.com/en-us" (site1).
Inside the network "sites" settings it is not possible to change the path for the main site.
How can i solve this?
Second problem - web.config redirect
It my first problem is solved I now want the URLs Redirect like this:
www.powerdoo.com -> www.powerdoo.com/en-us
www.powerdoo.de -> www.powerdoo.com/de-de
Can anybody help me how I have to write a rule for this?
Thanks Steffen
In that case you need to map the domains to the respective wp sites and have rewritten the base url.
This plugin will help you out to achieve those redirects, is extremely easy to set up and also it will take care of the base url rewrites.
https://wordpress.org/plugins/wordpress-mu-domain-mapping/
This way your sites will work fine with both URLs (www.powerdoo.com -> www.powerdoo.com/en-us) and most probably you won't need to mess up the theme's code.
The only thing you need to be aware of is that "if it gets to happen"
that on some places of your theme the base url rewrite doesn't work it
will be most probably due to the way the original url is generated by
WP engine inside of the theme. But if you are php handy you will be
able to fix it on the theme or the child-theme with a
str_replace();.

Forwarding slash in Wordpress URL

I am moving my site from Drupal to Wordpress.
In Drupal, I can easily give an alias to URL and this alias could be anything., ie: www.example.com/abc/xyz/hello.html
But in Wordpress, it appears that I cannot do that with WP out of the box.
Any hint on how to do the same with Wordpress? I need to keep URL consistence.
Thank you
I just found out this plugin https://wordpress.org/plugins/custom-permalinks/ and used it to add caracters like slashes and points, to the urls of a website i am moving to WordPress, so far it's working.
Hope it will help !
You may be interested in Settings -> Permalinks, but I think you want more than that.
Take a look at the feature list for the redirection plugin. This allows you to setup redirects to other pages or do pass through redirections. If this isn't what you are looking for then I think there are a couple other plugins that may accomplish what you want. Hope this helps!
You can change the default urls in the Settings -> Permalinks. You should also have the option to change the permalink when you add or edit a post. There are also plugins available for permalinks (http://wordpress.org/extend/plugins/advanced-permalinks/)

WordPress with Yahoo! Hosting... Almost there

EDIT:
Yeah, so this problem is really unsolvable. Yahoo prevents access to .htaccess, even from WordPress itself trying to change it. I had to settle for writing a script on the default homepage that redirects browsers to "www.abc.com/index.php" if they go straight to "www.abc.com". You always have to deal with "index.php" being in the address bar but it's better than not having permalinks...
/EDIT
Yahoo! Small Business hosting seems specifically engineered to make WordPress difficult-- but it's my client's host and there's not much I can do about it. I'm trying to move WordPress into the root directory, and I'm sooo close to having it done.
I've read and read and read about how to get the Permalinks to work right, and since Yahoo! hosting doesn't let you modify htaccess I am pretty much up s*** creek. I'm using the simple permalink structure of "/%postname%/", which once I moved to the root, stopped working. I have changed it to "/index.php/%postname%/", which allows you to see the pages if you manually type in index.php before the page name or if you are logged into the admin area and "View Page". Also, the correct permalink shows on all of the pages in the editor.
However, WordPress doesn't let you change the permalink of the static page you use as the front page.
Long story short, if I go to "www.abc.com/index.php", the links in the menu all work fine. However, if I just got to "www.abc.com", the links don't pick up the "index.php" from the permalink structure. I need to fix this, so if anyone knows how to either:
Change the permalink of the static front page
Fix something in the database if I install PhpMyAdmin
Work around not having access to .htaccess
Put a small script somewhere on the index page to append "index.php" to the url
Any other suggestions
It seems it would work if I was NOT using a static front page but rather the blog, but this isn't an option. I've tried changing the "Tag base" setting to no avail, as well as deactivating the Yahoo! Custom Permalinks plugin (and reactivating it again after that failed...). Could really use some help!
Check out Giving Wordpress its own directory. I can see how this could solve your problem. Also make sure that you have done the obvious, and change your url for WordPress address (URL) Site address (URL) inside the general settings page. Perhaps the static homepage should be developed outside of wordpress, and then you can follow the steps provided in the link I provided. Hope this solves your issue.
Yahoo doesn't allow users access to the htaccess file which means that you can't the mod_rewrite rules needed for custom permlinks. The Only way around it that i've heard it works (never tried it myself) is to add /index.php/ to the beginning of your custom structure so: Go to Permalink Settings > Select Custom Structure. And set the value as /index.php/%postname%/ or what ever you want as long as you add /index.php/ before it.
Hope this helps.
I had a similar problem with this host (in 2018! 4 years after your question) that I finally solved by changing the permalink settings.
Settings > Permalink Settings > Custom Structure: /index.php/%postname%/
I wish there was a better solution but Yahoo Small Business still doesn't allow .htaccess files - after several frustrating rounds with customer service, I finally admitted defeat and used this work around.

is site cloaking possible with a .htaccess file

i have created a wordpress site within a folder on a site and am having trouble moving the database so was looking in to ways of cloaking the sites url on every page with a .htaccess file. at the moment the site is a beta at www.christopherwaller.com. I wanted to look into removing the ugly URLS with page-id etc....
Does anyone know if this is possible. or if the .htaccess file is not the way to go
much appreciated
N
You can use the build in wordpress features, have a look at Permalinks
If your trying to change from
http://www.christopherwaller.com/wordpress/?page_id=240
to
http://www.christopherwaller.com/wordpress/about
Just navigate to your admin control panel, click on Configuration on the left menu, and then on Permalinks.
Fill the 'Custom' field with /%postname% and the links should appear as your expect.

Resources