logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: implement Wordpress htaccess
Author
tdkappa



Joined: 15 Feb 2017
Posts: 8

PostPosted: Wed 15 Feb '17 13:22    Post subject: implement Wordpress htaccess Reply with quote

Hello to evryone, and first of all sorry for my english!

I'm testing my Wordpress website in a localhost webserver

http://localhost/mywordpress/

the file .htaccess it's like below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngineOn
RewriteBase/mywordpress/
RewriteRule^index\.php$ -[L]
RewriteCond%{REQUEST_FILENAME}!-f
RewriteCond%{REQUEST_FILENAME}!-d
RewriteRule./mywordpress/index.php [L]
</IfModule>
# END WordPress


I would like to can resolve this address:

http://localhost/mywordpress/1/otherdb/
like this:
http://localhost/mywordpress/news.php?id_news=1

if I comment htaccess rules create by wordpress, it works

RewriteRule^mywordpress/([0-9]+)/([a-zA-Z0-9-]+)/$ mywordpress/news.php?id_news=$1

but with hataccess wordpress don't works.

How can I chenge the rules ?
Thank You for help !
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Wed 15 Feb '17 15:57    Post subject: Reply with quote

Don't change the htaccess file and the rewrite rules.

You can change it at /wp-admin/options-permalink.php

Example

Code:
/archives/%category%/%postname%-%post_id%/


or in your case maybe

Code:
/%category%/%postname%/


For sure the category can be news Wink
Back to top
tdkappa



Joined: 15 Feb 2017
Posts: 8

PostPosted: Mon 06 Mar '17 20:28    Post subject: Reply with quote

the file news.php isn't a wordpress category..

news.php it's a file extra-wordpress and I would like to resolve it:

http://localhost/mywordpress/1/otherdb/

with:

http://localhost/mywordpress/news.php?id_news=1
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Tue 14 Mar '17 11:56    Post subject: Reply with quote

The [L] in wordpress says that it is the last rule. So you need to put your new rule over the wordpress rule to get it applied.
Back to top
tdkappa



Joined: 15 Feb 2017
Posts: 8

PostPosted: Tue 14 Mar '17 17:52    Post subject: Reply with quote

James Blond wrote:
The [L] in wordpress says that it is the last rule. So you need to put your new rule over the wordpress rule to get it applied.


thank you so much! tonight I try your solution and I write you the results!
Back to top


Reply to topic   Topic: implement Wordpress htaccess View previous topic :: View next topic
Post new topic   Forum Index -> Apache